4. Anya writes a natural number, and Boris replaces one of its digits with a digit differing by 1. What is the smallest number Anya should write to ensure that the resulting number is guaranteed to be divisible by 11?
Answer: 909090909.

According to the divisibility rule for 11, the remainder of a number when divided by 11 is the same as the remainder of the alternating sum of its digits when divided by 11. Therefore, changing a digit by 1 also changes the remainder by 1 when divided by 11. This means the original number gives a remainder of 10 or 1 when divided by 11.

If the original number gives a remainder of 10 when divided by 11, then any change in its digits should increase the remainder of the alternating sum of its digits by 1 when divided by 11. Thus, the digits in odd positions (counting from the end) can only be increased by 1, and the digits in even positions can only be decreased by 1, i.e., the number has the form ...909090. The smallest number of this form that gives a remainder of 10 when divided by 11 is 9090909090.

If the original number gives a remainder of 1 when divided by 11, then, similarly, it has the form ...90909, and the smallest number that fits the condition is 909090909.