Rikka with Subsequence

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

As we all know, Rikka is not good at math. Yuta, her boyfriend, is worried about it. Therefore, he sets an interesting math problem For Rikka to practice.

Given a non-negative integer xx, Rikka is required to find three non-negative integers a,b,ca,b,c that satisfy the following three conditions:

  1. a+b=xa + b = x;
  2. str(c)\text{str}(c) is a subsequence of str(a)\text{str(a)};
  3. str(c)\text{str}(c) is a subsequence of str(b)\text{str(b)}.

str(d)\text{str}(d) represents the decimal string representation of integer dd. For example, str(0)=\text{str}(0)="00", str(103)=\text{str}(103)="103103".

String s=s_1s_ns=s\_1 \dots s\_{n} is a subsequence of string t=t_1t_mt=t\_1 \dots t\_{m} if and only if there exists an index sequence 1i_1<i_2<<i_nm1 \leq i\_1 < i\_2 < \dots < i\_n \leq m satisfying j\[1,n],s_j=t_i_j\forall j \in \[1,n], s\_j = t\_{i\_j}

To avoid the case of no solution, Yuta assumes there is a special choice "-" for cc where str()\text{str}(-) is equal to the empty string. Under this assumption, a=0,b=9,c=a=0, b=9, c=- becomes a valid solution of x=9x=9

Finding a valid solution is an easy task even for Rikka. Therefore, Rikka wants to increase the difficulty: Rikka wants you to find a valid solution (a,b,c)(a,b,c) so that the length of str(c)\text{str}(c) is as large as possible.

입력

The first line contains a single integer T (1T104)T\ (1\leq T\leq 10^4), representing the number of test cases.

For each test case, the first line contains a single integer x (str(x)5000)x\ (|\text{str}(x)| \leq 5000).

The input guarantees that str(x)105\sum |\text{str}(x)| \leq 10^5.

출력

For each test case, output three lines, each with a single integer, representing a,b,ca,b,c respectively.

If there are multiple optimal solutions, you need only to output any of them.