Subsequence MEX
시간 제한1초메모리 제한2048 MB
정수 x가 주어질 때, 소수 표기 부분수열들의 MEX가 정확히 x인 양의 정수 n을 하나 출력한다.
문제
Define a number to be a subsequence of a number if, when you write out in decimal notation, you can erase some (but not all) of its digits so that the remaining digits, in order, form . For example, is a subsequence of , because you can erase the , , , and to form . However, is not a subsequence of , because the digit is not present in .
You are given a number . Find any number such that the of the set of all subsequences of is equal to . It can be shown that such an always exists.
The of a set of integers is defined as the smallest non-negative integer which does not occur in the set. For example, the of is , and the of is .
입력
The first line of the input contains a single integer () --- the number of test cases. The description of the test cases follows.
Each test case consists of a single line containing an integer () --- the desired of the subsequences of . It is guaranteed that does not contain any leading zeroes.
It is guaranteed that the sum of the number of digits of across all test cases is at most .
출력
For each test case, output a single positive integer --- any number such that the of its subsequences is . may not contain leading zeroes.
If there are multiple solutions, you may print any.
The sum of the number of digits of across all test cases must not exceed .
힌트
In the first sample case, the subsequences of are , , and , and the of is .
In the second sample case, contains every digit except , and therefore the of its subsequences is .