OpenKattis
popup15 hemtal 12 [converted from problem group]

#### Start

2015-01-17 15:00 AKST

## popup15 hemtal 12 [converted from problem group]

#### End

2016-01-17 15:00 AKST
The end is near!
Session is over.
Not yet started.
Session is starting in -2190 days 10:04:15

8760:00:00

0:00:00

# Problem GMatchsticks

Matchsticks are ideal tools to represent numbers. A common way to represent the ten decimal digits with matchsticks is the following:

This is identical to how numbers are displayed on an ordinary alarm clock. With a given number of matchsticks you can generate a wide range of numbers. We are wondering what the smallest and largest numbers are that can be created by using all your matchsticks.

## Input

On the first line one positive number: the number of testcases, at most 100. After that per testcase:

• One line with an integer $n$ ($2\le n\le 100$): the number of matchsticks you have.

## Output

Per testcase:

• One line with the smallest and largest numbers you can create, separated by a single space. Both numbers should be positive and contain no leading zeroes.

Sample Input 1 Sample Output 1
4
3
6
7
15

7 7
6 111
8 711
108 7111111