Matchsticks

Time limit1sMemory limit128 MB

Problem

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.

DigitMatchsticks
06
12
25
35
44
55
66
73
87
96

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.

Input

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$)

Output

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.