Classical A+B Problem

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

문제

An integer is called a repdigit if it is positive and its decimal representation consists of repeated instances of the same digit. For example, 11, 666666, 44444444, and 999999999999 are repdigits, while 00, 4424444244, 5021650216, and 787788787788 are not.

You are given a positive integer nn. It is known that nn can be represented as n=a+bn = a + b, where aa and bb are repdigits. Find any such representation.

입력

Each test contains multiple test cases. The first line contains the number of test cases tt (1t1041 \le t \le 10^4). The description of the test cases follows.

The only line of each test case contains a single integer nn without leading zeros (2n<1040002 \le n < 10^{4000}). It is guaranteed that nn can be represented as n=a+bn = a + b, where aa and bb are repdigits.

It is guaranteed that the total number of digits in nn over all test cases does not exceed 10510^5.

출력

For each test case, print two integers aa and bb such that n=a+bn = a + b and both aa and bb are repdigits.

If there are multiple solutions, print any of them.