12. Given a 1998-digit number, every two adjacent digits of which form a two-digit number divisible by 17 or 23. The last digit of the number is 1. What is the first?
12. Let's start recording this number from the end. At some point, we will notice that the number has the form ...92346...9234692346851. Further, we see that the digits 92346 are repeating, so we subtract from 1998 the number of digits that do not belong to this cycle - 3. We divide the resulting number by 5 (the number of digits in the cycle). This number will divide evenly. Therefore, the first digit is 9.