REPNUM - Repeated Numbers

no tags 

We define a repeated number as a positive integer consisting of two or more instances of the same digit concatenated together. For example, 11 and 4444 are repeated numbers, while 5 and 11222 are not.

Given a positive integer n, your task is to find all repeated numbers that have fewer digits than n has.

Input

First an integer t (1 ≤ t ≤ 100), then on each of the next t lines an integer n (1 ≤ n < 1018).

Output

For each test case, print all repeated numbers that have fewer digits than n has, in ascending order.

Score

Your score is your source length.

Example

Input:

2
100
1234

Output:

11
22
33
44
55
66
77
88
99
11
22
33
44
55
66
77
88
99
111
222
333
444
555
666
777
888
999

hide comments
avinash: 2013-02-20 13:20:54

Can this problem be moved to shorten ?


Added by:avinash
Date:2013-02-20
Time limit:1s
Source limit:140B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:GAWK C C++ 4.3.2 CPP C99