Salah is really optimistic about the qualification of the Egyptian football team for the world cup 2018. He was thinking deeply about why it didn't happen often that the Egyptian team qualified to the world cup, so he decided to call 2018 a half-nice year. He comes up with the hypothesis that the Egyptian team will always qualify to the world cup only if it is held in a half-nice year. In order to test his hypothesis we need to find the largest half-nice number in a given range [A, B]. He says a given number X is half-nice if its decimal representation can be divided into two non-zero halves(of the same length) and the two halves have a non-trivial common divisor (there's a number d > 1 that divides both parts). In case a number X have odd number of digits (2r + 1), then the first half will have the first r digits in the decimal representation of X (from the left), and the second half will contain the remaining r + 1 digits in the decimal representation of X.
The first line of the input consists of a single integer 1 ≤ T ≤ 105 the number of test cases. Each test case consists of one line containing 2 space separated integers A, B, where 10 ≤ A ≤ B ≤ 1013.
For each test case output a single line displaying the case number, then followed by either a single integer X, which is the largest half-nice number in the range [A, B] or 'impossible' if there are no such numbers.
3
20 21
10 2019
4000 4005
Case 1: impossible
Case 2: 2018
Case 3: 4005
| Name |
|---|


