#CF1107B. Good times Good times 美好时光
Good times Good times 美好时光
当前没有测试数据。
CF测试跳转:https://codeforces.com/contest/2241/problem/B
An integer is said to be good if it contains at most two distinct digits in its decimal representation. For example, the integers , , are good, whereas the integers , are not.
You are given an integer (), which is good. Your task is to find an integer () such that both of the following conditions are satisfied:
- is good.
- is good.
Input
The first line contains an integer () — the number of test cases. The description of each test case follows.
Each test case contains a single integer (). It is guaranteed that is good.
Output
For each test case, print a single integer () such that both the integers and are good.
If there are multiple valid answers, output any one of them.
Exammple
4
8
73
299
6767
11
4
26
3366
Note
For the first test case, we have ; choosing is valid because both and are good.
For the second test case, we have ; choosing is valid because both and are good.