CF1788B.Sum of Two Numbers

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

Sum of Two Numbers

The sum of digits of a non-negative integer aa is the result of summing up its digits together when written in the decimal system. For example, the sum of digits of 123123 is 66 and the sum of digits of 1010 is 11. In a formal way, the sum of digits of a=umi=0ai10i\displaystyle a= um_{i=0}^{\infty} a_i \cdot 10^i, where 0ai90 \leq a_i \leq 9, is defined as umi=0ai\displaystyle um_{i=0}^{\infty}{a_i}.

Given an integer nn, find two non-negative integers xx and yy which satisfy the following conditions.

  • x+y=nx+y=n, and
  • the sum of digits of xx and the sum of digits of yy differ by at most 11.

It can be shown that such xx and yy always exist.

Input

Each test contains multiple test cases. The first line contains the number of test cases tt (1t100001 \le t \le 10\,000).

Each test case consists of a single integer nn (1n1091 \leq n \leq 10^9)

Output

For each test case, print two integers xx and yy.

If there are multiple answers, print any.

Note

In the second test case, the sum of digits of 6767 and the sum of digits of 9494 are both 1313.

In the third test case, the sum of digits of 6060 is 66, and the sum of digits of 77 is 77.

Samples

5
1
161
67
1206
19
1 0
67 94
60 7
1138 68
14 5

在线编程 IDE

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