Hide

Problem D
Smallest Repetitive Multiple

We consider a number to be “repetitive” if it has an even number of digits (without leading zeros) and its first and second halves are equal (as strings). For example, the numbers $11$, $1367213672$, and $6060$ are repetitive, but $4$, $1230123$, and $121212$ are not.

Given an integer $x$, find its smallest multiple that is repetitive.

Input

The first line of the input contains a single integer $t$ ($1 \le t \le 10^5$) —the number of test cases. The description of the test cases follows.

Each test case consists of a single line with an integer $x$ ($1 \le x \le 10^8$).

Output

For each test case, output a single integer —the smallest multiple of $x$ that is repetitive. We can show that an answer always exists.

Sample Input 1 Sample Output 1
12
1
5
12
100
101
707
2431
12883
12341234
20987639
64705883
100000000
11
55
1212
100100
1010
1414
102102
991991
12341234
1111110311111103
58823535882353
100000000100000000

Please log in to submit a solution to this problem

Log in