Classical A+B Problem
시간 제한4초메모리 제한1024 MB
4000자리 이하의 큰 양의 정수 n이 주어질 때, n = a + b를 만족하는 두 양의 렙디지트 a와 b를 찾는다.
문제
An integer is called a repdigit if it is positive and its decimal representation consists of repeated instances of the same digit. For example, , , , and are repdigits, while , , , and are not.
You are given a positive integer . It is known that can be represented as , where and are repdigits. Find any such representation.
입력
Each test contains multiple test cases. The first line contains the number of test cases (). The description of the test cases follows.
The only line of each test case contains a single integer without leading zeros (). It is guaranteed that can be represented as , where and are repdigits.
It is guaranteed that the total number of digits in over all test cases does not exceed .
출력
For each test case, print two integers and such that and both and are repdigits.
If there are multiple solutions, print any of them.