A finite sequence of four-digit integers has the property that the thousands, hundreds, and tens digits of each term are, respectively, the hundreds, tens, and units digits of the next term, and the units digit of the last term is the tens digit of the first term. For example, such a sequence might begin with 2475, 4758, 7584, 5842, and end with 8427. Let be the sum of all the terms in the sequence. What is the largest prime factor that always divides ?