CF2132B.The Secret Number

传统题 时间 2000 ms 内存 256 MiB 4 尝试 1 已通过 1 标签

The Secret Number

Vadim has thought of a number xx. To ensure that no one can guess it, he appended a positive number of zeros to the right of it, thus obtaining a new number yy. However, as a precaution, Vadim decided to spread the number n=x+yn = x + y. Find all suitable xx that Vadim could have thought of for the given nn.

Input

Each test consists of several test cases. The first line contains a single integer tt (1t104)(1 \le t \le 10^4) — the number of test cases. The following lines describe the test cases.

In a single line of each test case, there is an integer nn — the number spread by Vadim (11n1018)(11 \le n \le 10^{18}).

Output

For each number nn, output 00 if there are no suitable xx. Otherwise, output the number of suitable xx, followed by all suitable xx in ascending order.

Note

In the first sample, to 1111 one can append two zeros to the right, then 11+1100=111111 + 1100 = 1111, and to 101101 one can append one zero to the right, then 101+1010=1111101 + 1010 = 1111.

In the second sample, it is impossible to obtain 1212 through the described actions.

Samples

5
1111
12
55
999999999999999999
1000000000000000000
2
11 101
0
1
5
3
999999999 999000999000999 90909090909090909
0

在线编程 IDE

建议全屏模式获得最佳体验