Matchsticks are an ideal tool for representing numbers. Each digit of a decimal number is built from a fixed number of matchsticks according to the table below.
| Digit | Matchsticks |
|---|---|
| 0 | 6 |
| 1 | 2 |
| 2 | 5 |
| 3 | 5 |
| 4 | 4 |
| 5 | 5 |
| 6 | 6 |
| 7 | 3 |
| 8 | 7 |
| 9 | 6 |
Given a number of matchsticks, write a program that finds the smallest number and the largest number you can build using all of the matchsticks.
The first line contains the number of test cases, at most 100. Each test case consists of a single line containing the number of matchsticks $n$. ($2 \le n \le 100$)
For each test case, print the smallest number and the largest number that can be built using all of the given matchsticks, separated by a space, on one line. Both numbers must be positive and must not start with a zero.