Xiao fan is a third grader in Springfield Flower Kindergarten, and he learned multiplication of multi-digit numbers by one-digit numbers last week. Clever as he was, he soon found some unusual numbers -- multiplying these numbers by a specific one-digit integer kkk (2≤k≤92\le k\le 92≤k≤9) results in movement of some trailing digits to the front. For example, the following picture shows that 142857142857142857 is a 333-shifting number.
Xiao fan wants to find the largest
kkk-shifting number less than or equal to
nnn. However, this task is too difficult for him, so he turns to you for help!