You are given three integers a, b and c.

Find two positive integers x and y (x > 0, y > 0) such that: 

  * the decimal representation of x without leading zeroes consists of a digits; 
  * the decimal representation of y without leading zeroes consists of b digits; 
  * the decimal representation of gcd(x, y) without leading zeroes consists of c digits. 



gcd(x, y) denotes the [greatest common divisor (GCD)](https://en.wikipedia.org/wiki/Greatest_common_divisor) of integers x and y.

Output x and y. If there are multiple answers, output any of them.

Input

The first line contains a single integer t (1 ≤ t ≤ 285) — the number of testcases.

Each of the next t lines contains three integers a, b and c (1 ≤ a, b ≤ 9, 1 ≤ c ≤ min(a, b)) — the required lengths of the numbers.

It can be shown that the answer exists for all testcases under the given constraints.

Additional constraint on the input: all testcases are different.

Output

For each testcase print two positive integers — x and y (x > 0, y > 0) such that 

  * the decimal representation of x without leading zeroes consists of a digits; 
  * the decimal representation of y without leading zeroes consists of b digits; 
  * the decimal representation of gcd(x, y) without leading zeroes consists of c digits. 

Example

Input


4
2 3 1
2 2 2
6 6 2
1 1 1


Output


11 492
13 26
140133 160776
1 1

Note

In the example: 

  1. gcd(11, 492) = 1 
  2. gcd(13, 26) = 13 
  3. gcd(140133, 160776) = 21 
  4. gcd(1, 1) = 1

Difficulty: EASY
Tags: Number theory

Mathematics

Constructive algorithms

Starter code:

Solutions:
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	x = (10 ** (a - c) + 1) * 10 ** (c - 1)
	y = 10 ** (b - 1)
	print(x, y)


import sys
import math
import random
input = sys.stdin.readline
l = [1]
for i in range(8):
	l.append(l[-1] * 11)
t = int(input())
while t > 0:
	(a, b, c) = map(int, input().split())
	x = l[c - 1]
	y = l[c - 1]
	while len(str(x)) != a:
		x *= 2
	while len(str(y)) != b:
		y *= 5
	print(x, y)
	t -= 1


import math
for k in range(int(input())):
	(a, b, c) = list(map(int, input().split()))
	if a == b == c:
		x = ''
		for i in range(1, a + 1):
			x += str(i)
		y = int(x)
		print(x, x)
	elif a == b and c == 1:
		x = ''
		for i in range(1, a + 1):
			x += str(i)
		y = int(x)
		print(y, y + 1)
	elif a == b and c != 1:
		x = ''
		for i in range(1, c + 1):
			x += str(i)
		z = int(x)
		xx = ''
		for i in range(1, a + 1):
			xx += str(i)
		y = int(xx)
		ans = y // z
		ans = ans * z
		lol = ans / z
		lol = (lol + 1) * z
		print(int(ans), int(lol))
	else:
		x = ''
		for i in range(1, c + 1):
			x += str(i)
		z = int(x)
		xx = ''
		for i in range(1, a + 1):
			xx += str(i)
		dekhi = ''
		for i in range(1, b + 1):
			dekhi += str(i)
		g = int(dekhi)
		y = int(xx)
		while True:
			ans = y // z
			ans = y // z
			ans = ans * z
			ans2 = g // z
			ans2 = ans2 * z
			d = len(str(math.gcd(ans, ans2)))
			if d == c:
				break
			z += 1
		print(int(ans), int(ans2))


import math
MOD = 10 ** 9 + 7
R = lambda type=int: type(input().rstrip())
RV = lambda type=int: list(map(type, input().rstrip().split()))
RVV = lambda N, type=int: [RV(type) for _ in range(N)]

def solve():
	(a, b, c) = RV()
	x = 1
	while len(str(x)) < c:
		x *= 7
	y = x
	while len(str(x)) < a:
		x *= 5
	while len(str(y)) < b:
		y *= 3
	print(x, y)
T = R()
for t in range(T):
	solve()


x = int(input())
for i in range(x):
	(a, b, c) = [int(u) for u in input().split()]
	t = 10 ** (a - 1)
	g = 10 ** (c - 1)
	h = 10 ** (b - 1)
	if g == 1:
		print(t, h + 1)
		continue
	if t < h:
		q = h % t
		e = g - q
		h = h + e
		print(t, h)
	else:
		q = t % h
		e = g - q
		t = t + e
		print(t, h)


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	x = pow(10, a - 1)
	y = pow(10, c - 1)
	d = pow(10, b - c)
	mul = 1
	while mul < d:
		mul *= 3
	y *= mul
	print(x, y)


from math import ceil, gcd
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	C = 11 ** (c - 1)
	a = 11 ** (a - 1)
	A = ceil(a / C)
	b = 11 ** (b - 1)
	B = ceil(b / C)
	if gcd(A, B) > 1:
		B += 1
	print(A * C, B * C)


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	if a == 1 and b == 1 and (c == 1):
		print(1, 1)
	if a == 1 and b == 2 and (c == 1):
		print(1, 10)
	if a == 1 and b == 3 and (c == 1):
		print(1, 100)
	if a == 1 and b == 4 and (c == 1):
		print(1, 1000)
	if a == 1 and b == 5 and (c == 1):
		print(1, 10000)
	if a == 1 and b == 6 and (c == 1):
		print(1, 100000)
	if a == 1 and b == 7 and (c == 1):
		print(1, 1000000)
	if a == 1 and b == 8 and (c == 1):
		print(1, 10000000)
	if a == 1 and b == 9 and (c == 1):
		print(1, 100000000)
	if a == 2 and b == 1 and (c == 1):
		print(10, 1)
	if a == 2 and b == 2 and (c == 1):
		print(10, 11)
	if a == 2 and b == 2 and (c == 2):
		print(10, 10)
	if a == 2 and b == 3 and (c == 1):
		print(10, 101)
	if a == 2 and b == 3 and (c == 2):
		print(10, 100)
	if a == 2 and b == 4 and (c == 1):
		print(10, 1001)
	if a == 2 and b == 4 and (c == 2):
		print(10, 1000)
	if a == 2 and b == 5 and (c == 1):
		print(10, 10001)
	if a == 2 and b == 5 and (c == 2):
		print(10, 10000)
	if a == 2 and b == 6 and (c == 1):
		print(10, 100001)
	if a == 2 and b == 6 and (c == 2):
		print(10, 100000)
	if a == 2 and b == 7 and (c == 1):
		print(10, 1000001)
	if a == 2 and b == 7 and (c == 2):
		print(10, 1000000)
	if a == 2 and b == 8 and (c == 1):
		print(10, 10000001)
	if a == 2 and b == 8 and (c == 2):
		print(10, 10000000)
	if a == 2 and b == 9 and (c == 1):
		print(10, 100000001)
	if a == 2 and b == 9 and (c == 2):
		print(10, 100000000)
	if a == 3 and b == 1 and (c == 1):
		print(100, 1)
	if a == 3 and b == 2 and (c == 1):
		print(100, 11)
	if a == 3 and b == 2 and (c == 2):
		print(100, 10)
	if a == 3 and b == 3 and (c == 1):
		print(100, 101)
	if a == 3 and b == 3 and (c == 2):
		print(100, 110)
	if a == 3 and b == 3 and (c == 3):
		print(100, 100)
	if a == 3 and b == 4 and (c == 1):
		print(100, 1001)
	if a == 3 and b == 4 and (c == 2):
		print(100, 1010)
	if a == 3 and b == 4 and (c == 3):
		print(100, 1000)
	if a == 3 and b == 5 and (c == 1):
		print(100, 10001)
	if a == 3 and b == 5 and (c == 2):
		print(100, 10010)
	if a == 3 and b == 5 and (c == 3):
		print(100, 10000)
	if a == 3 and b == 6 and (c == 1):
		print(100, 100001)
	if a == 3 and b == 6 and (c == 2):
		print(100, 100010)
	if a == 3 and b == 6 and (c == 3):
		print(100, 100000)
	if a == 3 and b == 7 and (c == 1):
		print(100, 1000001)
	if a == 3 and b == 7 and (c == 2):
		print(100, 1000010)
	if a == 3 and b == 7 and (c == 3):
		print(100, 1000000)
	if a == 3 and b == 8 and (c == 1):
		print(100, 10000001)
	if a == 3 and b == 8 and (c == 2):
		print(100, 10000010)
	if a == 3 and b == 8 and (c == 3):
		print(100, 10000000)
	if a == 3 and b == 9 and (c == 1):
		print(100, 100000001)
	if a == 3 and b == 9 and (c == 2):
		print(100, 100000010)
	if a == 3 and b == 9 and (c == 3):
		print(100, 100000000)
	if a == 4 and b == 1 and (c == 1):
		print(1000, 1)
	if a == 4 and b == 2 and (c == 1):
		print(1000, 11)
	if a == 4 and b == 2 and (c == 2):
		print(1000, 10)
	if a == 4 and b == 3 and (c == 1):
		print(1000, 101)
	if a == 4 and b == 3 and (c == 2):
		print(1000, 110)
	if a == 4 and b == 3 and (c == 3):
		print(1000, 100)
	if a == 4 and b == 4 and (c == 1):
		print(1000, 1001)
	if a == 4 and b == 4 and (c == 2):
		print(1000, 1010)
	if a == 4 and b == 4 and (c == 3):
		print(1000, 1100)
	if a == 4 and b == 4 and (c == 4):
		print(1000, 1000)
	if a == 4 and b == 5 and (c == 1):
		print(1000, 10001)
	if a == 4 and b == 5 and (c == 2):
		print(1000, 10010)
	if a == 4 and b == 5 and (c == 3):
		print(1000, 10100)
	if a == 4 and b == 5 and (c == 4):
		print(1000, 10000)
	if a == 4 and b == 6 and (c == 1):
		print(1000, 100001)
	if a == 4 and b == 6 and (c == 2):
		print(1000, 100010)
	if a == 4 and b == 6 and (c == 3):
		print(1000, 100100)
	if a == 4 and b == 6 and (c == 4):
		print(1000, 100000)
	if a == 4 and b == 7 and (c == 1):
		print(1000, 1000001)
	if a == 4 and b == 7 and (c == 2):
		print(1000, 1000010)
	if a == 4 and b == 7 and (c == 3):
		print(1000, 1000100)
	if a == 4 and b == 7 and (c == 4):
		print(1000, 1000000)
	if a == 4 and b == 8 and (c == 1):
		print(1000, 10000001)
	if a == 4 and b == 8 and (c == 2):
		print(1000, 10000010)
	if a == 4 and b == 8 and (c == 3):
		print(1000, 10000100)
	if a == 4 and b == 8 and (c == 4):
		print(1000, 10000000)
	if a == 4 and b == 9 and (c == 1):
		print(1000, 100000001)
	if a == 4 and b == 9 and (c == 2):
		print(1000, 100000010)
	if a == 4 and b == 9 and (c == 3):
		print(1000, 100000100)
	if a == 4 and b == 9 and (c == 4):
		print(1000, 100000000)
	if a == 5 and b == 1 and (c == 1):
		print(10000, 1)
	if a == 5 and b == 2 and (c == 1):
		print(10000, 11)
	if a == 5 and b == 2 and (c == 2):
		print(10000, 10)
	if a == 5 and b == 3 and (c == 1):
		print(10000, 101)
	if a == 5 and b == 3 and (c == 2):
		print(10000, 110)
	if a == 5 and b == 3 and (c == 3):
		print(10000, 100)
	if a == 5 and b == 4 and (c == 1):
		print(10000, 1001)
	if a == 5 and b == 4 and (c == 2):
		print(10000, 1008)
	if a == 5 and b == 4 and (c == 3):
		print(10000, 1100)
	if a == 5 and b == 4 and (c == 4):
		print(10000, 1000)
	if a == 5 and b == 5 and (c == 1):
		print(10000, 10001)
	if a == 5 and b == 5 and (c == 2):
		print(10000, 10010)
	if a == 5 and b == 5 and (c == 3):
		print(10000, 10100)
	if a == 5 and b == 5 and (c == 4):
		print(10000, 11000)
	if a == 5 and b == 5 and (c == 5):
		print(10000, 10000)
	if a == 5 and b == 6 and (c == 1):
		print(10000, 100001)
	if a == 5 and b == 6 and (c == 2):
		print(10000, 100010)
	if a == 5 and b == 6 and (c == 3):
		print(10000, 100100)
	if a == 5 and b == 6 and (c == 4):
		print(10000, 101000)
	if a == 5 and b == 6 and (c == 5):
		print(10000, 100000)
	if a == 5 and b == 7 and (c == 1):
		print(10000, 1000001)
	if a == 5 and b == 7 and (c == 2):
		print(10000, 1000010)
	if a == 5 and b == 7 and (c == 3):
		print(10000, 1000100)
	if a == 5 and b == 7 and (c == 4):
		print(10000, 1001000)
	if a == 5 and b == 7 and (c == 5):
		print(10000, 1000000)
	if a == 5 and b == 8 and (c == 1):
		print(10000, 10000001)
	if a == 5 and b == 8 and (c == 2):
		print(10000, 10000010)
	if a == 5 and b == 8 and (c == 3):
		print(10000, 10000100)
	if a == 5 and b == 8 and (c == 4):
		print(10000, 10001000)
	if a == 5 and b == 8 and (c == 5):
		print(10000, 10000000)
	if a == 5 and b == 9 and (c == 1):
		print(10000, 100000001)
	if a == 5 and b == 9 and (c == 2):
		print(10000, 100000010)
	if a == 5 and b == 9 and (c == 3):
		print(10000, 100000100)
	if a == 5 and b == 9 and (c == 4):
		print(10000, 100001000)
	if a == 5 and b == 9 and (c == 5):
		print(10000, 100000000)
	if a == 6 and b == 1 and (c == 1):
		print(100000, 1)
	if a == 6 and b == 2 and (c == 1):
		print(100000, 11)
	if a == 6 and b == 2 and (c == 2):
		print(100000, 10)
	if a == 6 and b == 3 and (c == 1):
		print(100000, 101)
	if a == 6 and b == 3 and (c == 2):
		print(100000, 110)
	if a == 6 and b == 3 and (c == 3):
		print(100000, 100)
	if a == 6 and b == 4 and (c == 1):
		print(100000, 1001)
	if a == 6 and b == 4 and (c == 2):
		print(100000, 1008)
	if a == 6 and b == 4 and (c == 3):
		print(100000, 1100)
	if a == 6 and b == 4 and (c == 4):
		print(100000, 1000)
	if a == 6 and b == 5 and (c == 1):
		print(100000, 10001)
	if a == 6 and b == 5 and (c == 2):
		print(100000, 10010)
	if a == 6 and b == 5 and (c == 3):
		print(100000, 10080)
	if a == 6 and b == 5 and (c == 4):
		print(100000, 11000)
	if a == 6 and b == 5 and (c == 5):
		print(100000, 10000)
	if a == 6 and b == 6 and (c == 1):
		print(100000, 100001)
	if a == 6 and b == 6 and (c == 2):
		print(100000, 100010)
	if a == 6 and b == 6 and (c == 3):
		print(100000, 100100)
	if a == 6 and b == 6 and (c == 4):
		print(100000, 101000)
	if a == 6 and b == 6 and (c == 5):
		print(100000, 110000)
	if a == 6 and b == 6 and (c == 6):
		print(100000, 100000)
	if a == 6 and b == 7 and (c == 1):
		print(100000, 1000001)
	if a == 6 and b == 7 and (c == 2):
		print(100000, 1000010)
	if a == 6 and b == 7 and (c == 3):
		print(100000, 1000100)
	if a == 6 and b == 7 and (c == 4):
		print(100000, 1001000)
	if a == 6 and b == 7 and (c == 5):
		print(100000, 1010000)
	if a == 6 and b == 7 and (c == 6):
		print(100000, 1000000)
	if a == 6 and b == 8 and (c == 1):
		print(100000, 10000001)
	if a == 6 and b == 8 and (c == 2):
		print(100000, 10000010)
	if a == 6 and b == 8 and (c == 3):
		print(100000, 10000100)
	if a == 6 and b == 8 and (c == 4):
		print(100000, 10001000)
	if a == 6 and b == 8 and (c == 5):
		print(100000, 10010000)
	if a == 6 and b == 8 and (c == 6):
		print(100000, 10000000)
	if a == 6 and b == 9 and (c == 1):
		print(100000, 100000001)
	if a == 6 and b == 9 and (c == 2):
		print(100000, 100000010)
	if a == 6 and b == 9 and (c == 3):
		print(100000, 100000100)
	if a == 6 and b == 9 and (c == 4):
		print(100000, 100001000)
	if a == 6 and b == 9 and (c == 5):
		print(100000, 100010000)
	if a == 6 and b == 9 and (c == 6):
		print(100000, 100000000)
	if a == 7 and b == 1 and (c == 1):
		print(1000000, 1)
	if a == 7 and b == 2 and (c == 1):
		print(1000000, 11)
	if a == 7 and b == 2 and (c == 2):
		print(1000000, 10)
	if a == 7 and b == 3 and (c == 1):
		print(1000000, 101)
	if a == 7 and b == 3 and (c == 2):
		print(1000000, 110)
	if a == 7 and b == 3 and (c == 3):
		print(1000000, 100)
	if a == 7 and b == 4 and (c == 1):
		print(1000000, 1001)
	if a == 7 and b == 4 and (c == 2):
		print(1000000, 1008)
	if a == 7 and b == 4 and (c == 3):
		print(1000000, 1100)
	if a == 7 and b == 4 and (c == 4):
		print(1000000, 1000)
	if a == 7 and b == 5 and (c == 1):
		print(1000000, 10001)
	if a == 7 and b == 5 and (c == 2):
		print(1000000, 10010)
	if a == 7 and b == 5 and (c == 3):
		print(1000000, 10080)
	if a == 7 and b == 5 and (c == 4):
		print(1000000, 11000)
	if a == 7 and b == 5 and (c == 5):
		print(1000000, 10000)
	if a == 7 and b == 6 and (c == 1):
		print(1000000, 100001)
	if a == 7 and b == 6 and (c == 2):
		print(1000000, 100010)
	if a == 7 and b == 6 and (c == 3):
		print(1000000, 100100)
	if a == 7 and b == 6 and (c == 4):
		print(1000000, 100800)
	if a == 7 and b == 6 and (c == 5):
		print(1000000, 109375)
	if a == 7 and b == 6 and (c == 6):
		print(1000000, 100000)
	if a == 7 and b == 7 and (c == 1):
		print(1000000, 1000001)
	if a == 7 and b == 7 and (c == 2):
		print(1000000, 1000010)
	if a == 7 and b == 7 and (c == 3):
		print(1000000, 1000100)
	if a == 7 and b == 7 and (c == 4):
		print(1000000, 1001000)
	if a == 7 and b == 7 and (c == 5):
		print(1000000, 1010000)
	if a == 7 and b == 7 and (c == 6):
		print(1000000, 1100000)
	if a == 7 and b == 7 and (c == 7):
		print(1000000, 1000000)
	if a == 7 and b == 8 and (c == 1):
		print(1000000, 10000001)
	if a == 7 and b == 8 and (c == 2):
		print(1000000, 10000010)
	if a == 7 and b == 8 and (c == 3):
		print(1000000, 10000100)
	if a == 7 and b == 8 and (c == 4):
		print(1000000, 10001000)
	if a == 7 and b == 8 and (c == 5):
		print(1000000, 10010000)
	if a == 7 and b == 8 and (c == 6):
		print(1000000, 10100000)
	if a == 7 and b == 8 and (c == 7):
		print(1000000, 10000000)
	if a == 7 and b == 9 and (c == 1):
		print(1000000, 100000001)
	if a == 7 and b == 9 and (c == 2):
		print(1000000, 100000010)
	if a == 7 and b == 9 and (c == 3):
		print(1000000, 100000100)
	if a == 7 and b == 9 and (c == 4):
		print(1000000, 100001000)
	if a == 7 and b == 9 and (c == 5):
		print(1000000, 100010000)
	if a == 7 and b == 9 and (c == 6):
		print(1000000, 100100000)
	if a == 7 and b == 9 and (c == 7):
		print(1000000, 100000000)
	if a == 8 and b == 1 and (c == 1):
		print(10000000, 1)
	if a == 8 and b == 2 and (c == 1):
		print(10000000, 11)
	if a == 8 and b == 2 and (c == 2):
		print(10000000, 10)
	if a == 8 and b == 3 and (c == 1):
		print(10000000, 101)
	if a == 8 and b == 3 and (c == 2):
		print(10000000, 110)
	if a == 8 and b == 3 and (c == 3):
		print(10000000, 100)
	if a == 8 and b == 4 and (c == 1):
		print(10000000, 1001)
	if a == 8 and b == 4 and (c == 2):
		print(10000000, 1008)
	if a == 8 and b == 4 and (c == 3):
		print(10000000, 1024)
	if a == 8 and b == 4 and (c == 4):
		print(10000000, 1000)
	if a == 8 and b == 5 and (c == 1):
		print(10000000, 10001)
	if a == 8 and b == 5 and (c == 2):
		print(10000000, 10010)
	if a == 8 and b == 5 and (c == 3):
		print(10000000, 10080)
	if a == 8 and b == 5 and (c == 4):
		print(10000000, 11000)
	if a == 8 and b == 5 and (c == 5):
		print(10000000, 10000)
	if a == 8 and b == 6 and (c == 1):
		print(10000000, 100001)
	if a == 8 and b == 6 and (c == 2):
		print(10000000, 100010)
	if a == 8 and b == 6 and (c == 3):
		print(10000000, 100096)
	if a == 8 and b == 6 and (c == 4):
		print(10000000, 100800)
	if a == 8 and b == 6 and (c == 5):
		print(10000000, 109375)
	if a == 8 and b == 6 and (c == 6):
		print(10000000, 100000)
	if a == 8 and b == 7 and (c == 1):
		print(10000000, 1000001)
	if a == 8 and b == 7 and (c == 2):
		print(10000000, 1000010)
	if a == 8 and b == 7 and (c == 3):
		print(10000000, 1000064)
	if a == 8 and b == 7 and (c == 4):
		print(10000000, 1001000)
	if a == 8 and b == 7 and (c == 5):
		print(10000000, 1008000)
	if a == 8 and b == 7 and (c == 6):
		print(10000000, 1093750)
	if a == 8 and b == 7 and (c == 7):
		print(10000000, 1000000)
	if a == 8 and b == 8 and (c == 1):
		print(10000000, 10000001)
	if a == 8 and b == 8 and (c == 2):
		print(10000000, 10000010)
	if a == 8 and b == 8 and (c == 3):
		print(10000000, 10000100)
	if a == 8 and b == 8 and (c == 4):
		print(10000000, 10001000)
	if a == 8 and b == 8 and (c == 5):
		print(10000000, 10010000)
	if a == 8 and b == 8 and (c == 6):
		print(10000000, 10100000)
	if a == 8 and b == 8 and (c == 7):
		print(10000000, 11000000)
	if a == 8 and b == 8 and (c == 8):
		print(10000000, 10000000)
	if a == 8 and b == 9 and (c == 1):
		print(10000000, 100000001)
	if a == 8 and b == 9 and (c == 2):
		print(10000000, 100000010)
	if a == 8 and b == 9 and (c == 3):
		print(10000000, 100000100)
	if a == 8 and b == 9 and (c == 4):
		print(10000000, 100001000)
	if a == 8 and b == 9 and (c == 5):
		print(10000000, 100010000)
	if a == 8 and b == 9 and (c == 6):
		print(10000000, 100100000)
	if a == 8 and b == 9 and (c == 7):
		print(10000000, 101000000)
	if a == 8 and b == 9 and (c == 8):
		print(10000000, 100000000)
	if a == 9 and b == 1 and (c == 1):
		print(100000000, 1)
	if a == 9 and b == 2 and (c == 1):
		print(100000000, 11)
	if a == 9 and b == 2 and (c == 2):
		print(100000000, 10)
	if a == 9 and b == 3 and (c == 1):
		print(100000000, 101)
	if a == 9 and b == 3 and (c == 2):
		print(100000000, 110)
	if a == 9 and b == 3 and (c == 3):
		print(100000000, 100)
	if a == 9 and b == 4 and (c == 1):
		print(100000000, 1001)
	if a == 9 and b == 4 and (c == 2):
		print(100000000, 1008)
	if a == 9 and b == 4 and (c == 3):
		print(100000000, 1024)
	if a == 9 and b == 4 and (c == 4):
		print(100000000, 1000)
	if a == 9 and b == 5 and (c == 1):
		print(100000000, 10001)
	if a == 9 and b == 5 and (c == 2):
		print(100000000, 10010)
	if a == 9 and b == 5 and (c == 3):
		print(100000000, 10080)
	if a == 9 and b == 5 and (c == 4):
		print(100000000, 10240)
	if a == 9 and b == 5 and (c == 5):
		print(100000000, 10000)
	if a == 9 and b == 6 and (c == 1):
		print(100000000, 100001)
	if a == 9 and b == 6 and (c == 2):
		print(100000000, 100010)
	if a == 9 and b == 6 and (c == 3):
		print(100000000, 100096)
	if a == 9 and b == 6 and (c == 4):
		print(100000000, 100800)
	if a == 9 and b == 6 and (c == 5):
		print(100000000, 109375)
	if a == 9 and b == 6 and (c == 6):
		print(100000000, 100000)
	if a == 9 and b == 7 and (c == 1):
		print(100000000, 1000001)
	if a == 9 and b == 7 and (c == 2):
		print(100000000, 1000010)
	if a == 9 and b == 7 and (c == 3):
		print(100000000, 1000064)
	if a == 9 and b == 7 and (c == 4):
		print(100000000, 1000960)
	if a == 9 and b == 7 and (c == 5):
		print(100000000, 1008000)
	if a == 9 and b == 7 and (c == 6):
		print(100000000, 1093750)
	if a == 9 and b == 7 and (c == 7):
		print(100000000, 1000000)
	if a == 9 and b == 8 and (c == 1):
		print(100000000, 10000001)
	if a == 9 and b == 8 and (c == 2):
		print(100000000, 10000010)
	if a == 9 and b == 8 and (c == 3):
		print(100000000, 10000100)
	if a == 9 and b == 8 and (c == 4):
		print(100000000, 10000640)
	if a == 9 and b == 8 and (c == 5):
		print(100000000, 10010000)
	if a == 9 and b == 8 and (c == 6):
		print(100000000, 10080000)
	if a == 9 and b == 8 and (c == 7):
		print(100000000, 10937500)
	if a == 9 and b == 8 and (c == 8):
		print(100000000, 10000000)
	if a == 9 and b == 9 and (c == 1):
		print(100000000, 100000001)
	if a == 9 and b == 9 and (c == 2):
		print(100000000, 100000010)
	if a == 9 and b == 9 and (c == 3):
		print(100000000, 100000100)
	if a == 9 and b == 9 and (c == 4):
		print(100000000, 100001000)
	if a == 9 and b == 9 and (c == 5):
		print(100000000, 100010000)
	if a == 9 and b == 9 and (c == 6):
		print(100000000, 100100000)
	if a == 9 and b == 9 and (c == 7):
		print(100000000, 101000000)
	if a == 9 and b == 9 and (c == 8):
		print(100000000, 110000000)
	if a == 9 and b == 9 and (c == 9):
		print(100000000, 100000000)


t = int(input())
for _t in range(t):
	a = list(map(int, input().split()))
	x = 10 ** (a[0] - 1)
	y = 10 ** (a[1] - 1) + 10 ** (a[2] - 1)
	print(x, y)


import math
p = [2, 11, 101, 1009, 10007, 100003, 1000003, 10000019, 100000007]
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	x = p[c - 1] * 10 ** (a - c)
	y = p[c - 1] * 10 ** (b - c) + p[c - 1]
	print(x, y)


from collections import defaultdict, deque
import sys
from math import gcd
input = sys.stdin.readline
t = int(input().rstrip())
mod = 10 ** 9 + 7
for _ in range(t):
	(a, b, c) = map(int, input().strip().rsplit())
	if a > b:
		a_num = 1
		while True:
			if len(str(a_num)) == a:
				break
			a_num *= 2
		b_num = 1
		while True:
			if len(str(b_num)) == c:
				break
			b_num *= 2
		while True:
			if len(str(b_num)) == b:
				break
			b_num *= 3
	else:
		b_num = 1
		while True:
			if len(str(b_num)) == b:
				break
			b_num *= 2
		a_num = 1
		while True:
			if len(str(a_num)) == c:
				break
			a_num *= 2
		while True:
			if len(str(a_num)) == a:
				break
			a_num *= 3
	print(a_num, b_num)


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	C = 10 ** (c - 1)
	A = C
	B = C
	while len(str(A)) < a:
		A *= 2
	while len(str(B)) < b:
		B *= 3
	print(A, B)


from math import gcd
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	x = 0
	y = 0
	if c == 1:
		x = int('1' * a)
		y = int('1' * b)
		while gcd(x, y) > 1:
			y += 1
	elif a == b == c:
		x = int('1' * a)
		y = int('1' * b)
	else:
		x = int('1' + '0' * (a - 1))
		y = int('1' * (b - c + 1) + '0' * (c - 1))
	print(x, y)


import math
for _ in range(int(input())):
	(a, b, c) = list(map(int, input().split()))
	if b > a:
		cn = '1' + '0' * (c - 1)
		an = '1' + '0' * (a - 1)
		bn = '1' * (b > c) + (b - c - 1) * '0' + cn
		print(an, bn)
	else:
		cn = '1' + '0' * (c - 1)
		bn = '1' + '0' * (b - 1)
		an = '1' * (a > c) + (a - c - 1) * '0' + cn
		print(an, bn)


def Sort(sub_li):
	return sorted(sub_li, key=lambda x: x[1])
import math
n = int(input())
mod = 10 ** 9 + 7
for i in range(0, n):
	p = input().rstrip().split(' ')
	a = int(p[0])
	b = int(p[1])
	c = int(p[2])
	Q = []
	G = 0
	if a > b:
		G = 1
		(a, b) = (b, a)
	S = 1
	for j in range(0, a - 1):
		S = S * 10
	if 1:
		L = []
		L.append(S)
		D = 1
		for j in range(0, c - 1):
			D = D * 10
		b = b - c
		if b > 0:
			F = 1
			for j in range(0, b - 1):
				F = F * 10
			x = list(str(D))
			y = list(str(F))
			z = y + x
		else:
			z = list(str(D))
		L.append(int(''.join(z)))
		if G == 1:
			L.reverse()
		print(*L)


import sys
import math
from collections import Counter, defaultdict
LI = lambda : list(map(int, input().split()))
MAP = lambda : map(int, input().split())
IN = lambda : int(input())
S = lambda : input()
mod = 10 ** 9 + 7

def case():
	(a, b, c) = MAP()
	if a == b == c:
		print(10 ** (a - 1), 10 ** (a - 1))
	else:
		if a > b:
			(x, y) = (10 ** (a - 1) + 10 ** (c - 1), 10 ** (b - 1))
		else:
			(x, y) = (10 ** (a - 1), 10 ** (b - 1) + 10 ** (c - 1))
		print(x, y)
for _ in range(IN()):
	case()


from math import gcd

def solve():
	(a, b, c) = map(int, input().split())
	print(*res[a - 1][b - 1][c - 1])
res = [[[[2, 2], [11, 11], [101, 101], [1009, 1009], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[2, 10], [11, 11], [101, 101], [1009, 1009], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[2, 100], [11, 110], [101, 101], [1009, 1009], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[2, 1000], [11, 1001], [101, 1010], [1009, 1009], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[2, 10000], [11, 10010], [101, 10100], [1009, 10090], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[2, 100000], [11, 100001], [101, 100091], [1009, 100900], [10007, 100070], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[2, 1000000], [11, 1000010], [101, 1000001], [1009, 1000928], [10007, 1000700], [100003, 1000030], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[2, 10000000], [11, 10000001], [101, 10000010], [1009, 10000199], [10007, 10007000], [100003, 10000300], [1000033, 10000330], [10000019, 10000019], [100000007, 100000007]], [[2, 100000000], [11, 100000010], [101, 100000100], [1009, 100000981], [10007, 100009958], [100003, 100003000], [1000033, 100003300], [10000019, 100000190], [100000007, 100000007]]], [[[10, 2], [11, 11], [101, 101], [1009, 1009], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10, 12], [11, 11], [101, 101], [1009, 1009], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10, 102], [11, 110], [101, 101], [1009, 1009], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10, 1002], [11, 1001], [101, 1010], [1009, 1009], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10, 10002], [11, 10010], [101, 10100], [1009, 10090], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10, 100002], [11, 100001], [101, 100091], [1009, 100900], [10007, 100070], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10, 1000002], [11, 1000010], [101, 1000001], [1009, 1000928], [10007, 1000700], [100003, 1000030], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10, 10000002], [11, 10000001], [101, 10000010], [1009, 10000199], [10007, 10007000], [100003, 10000300], [1000033, 10000330], [10000019, 10000019], [100000007, 100000007]], [[10, 100000002], [11, 100000010], [101, 100000100], [1009, 100000981], [10007, 100009958], [100003, 100003000], [1000033, 100003300], [10000019, 100000190], [100000007, 100000007]]], [[[100, 2], [110, 11], [101, 101], [1009, 1009], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[100, 14], [110, 11], [101, 101], [1009, 1009], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[100, 102], [110, 121], [101, 101], [1009, 1009], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[100, 1002], [110, 1001], [101, 1010], [1009, 1009], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[100, 10002], [110, 10021], [101, 10100], [1009, 10090], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[100, 100002], [110, 100001], [101, 100091], [1009, 100900], [10007, 100070], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[100, 1000002], [110, 1000021], [101, 1000001], [1009, 1000928], [10007, 1000700], [100003, 1000030], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[100, 10000002], [110, 10000001], [101, 10000010], [1009, 10000199], [10007, 10007000], [100003, 10000300], [1000033, 10000330], [10000019, 10000019], [100000007, 100000007]], [[100, 100000002], [110, 100000021], [101, 100000100], [1009, 100000981], [10007, 100009958], [100003, 100003000], [1000033, 100003300], [10000019, 100000190], [100000007, 100000007]]], [[[1000, 2], [1001, 11], [1010, 101], [1009, 1009], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[1000, 14], [1001, 11], [1010, 101], [1009, 1009], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[1000, 102], [1001, 110], [1010, 101], [1009, 1009], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[1000, 1002], [1001, 1012], [1010, 1111], [1009, 1009], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[1000, 10002], [1001, 10021], [1010, 10201], [1009, 10090], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[1000, 100002], [1001, 100001], [1010, 100091], [1009, 100900], [10007, 100070], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[1000, 1000002], [1001, 1000010], [1010, 1000001], [1009, 1000928], [10007, 1000700], [100003, 1000030], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[1000, 10000002], [1001, 10000001], [1010, 10000111], [1009, 10000199], [10007, 10007000], [100003, 10000300], [1000033, 10000330], [10000019, 10000019], [100000007, 100000007]], [[1000, 100000002], [1001, 100000010], [1010, 100000201], [1009, 100000981], [10007, 100009958], [100003, 100003000], [1000033, 100003300], [10000019, 100000190], [100000007, 100000007]]], [[[10000, 2], [10010, 11], [10100, 101], [10090, 1009], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10000, 14], [10010, 11], [10100, 101], [10090, 1009], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10000, 102], [10010, 121], [10100, 101], [10090, 1009], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10000, 1002], [10010, 1023], [10100, 1111], [10090, 1009], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10000, 10002], [10010, 10021], [10100, 10201], [10090, 11099], [10007, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10000, 100002], [10010, 100001], [10100, 100091], [10090, 101909], [10007, 100070], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10000, 1000002], [10010, 1000021], [10100, 1000001], [10090, 1001937], [10007, 1000700], [100003, 1000030], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10000, 10000002], [10010, 10000001], [10100, 10000111], [10090, 10000199], [10007, 10007000], [100003, 10000300], [1000033, 10000330], [10000019, 10000019], [100000007, 100000007]], [[10000, 100000002], [10010, 100000021], [10100, 100000201], [10090, 100000981], [10007, 100009958], [100003, 100003000], [1000033, 100003300], [10000019, 100000190], [100000007, 100000007]]], [[[100000, 2], [100001, 11], [100091, 101], [100900, 1009], [100070, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[100000, 14], [100001, 11], [100091, 101], [100900, 1009], [100070, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[100000, 102], [100001, 110], [100091, 101], [100900, 1009], [100070, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[100000, 1002], [100001, 1001], [100091, 1010], [100900, 1009], [100070, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[100000, 10002], [100001, 10010], [100091, 10100], [100900, 11099], [100070, 10007], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[100000, 100002], [100001, 100012], [100091, 100192], [100900, 101909], [100070, 110077], [100003, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[100000, 1000002], [100001, 1000021], [100091, 1000001], [100900, 1001937], [100070, 1010707], [100003, 1000030], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[100000, 10000002], [100001, 10000001], [100091, 10000010], [100900, 10000199], [100070, 10017007], [100003, 10000300], [1000033, 10000330], [10000019, 10000019], [100000007, 100000007]], [[100000, 100000002], [100001, 100000010], [100091, 100000100], [100900, 100000981], [100070, 100039979], [100003, 100003000], [1000033, 100003300], [10000019, 100000190], [100000007, 100000007]]], [[[1000000, 2], [1000010, 11], [1000001, 101], [1000928, 1009], [1000700, 10007], [1000030, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[1000000, 14], [1000010, 11], [1000001, 101], [1000928, 1009], [1000700, 10007], [1000030, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[1000000, 102], [1000010, 121], [1000001, 101], [1000928, 1009], [1000700, 10007], [1000030, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[1000000, 1002], [1000010, 1001], [1000001, 1010], [1000928, 1009], [1000700, 10007], [1000030, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[1000000, 10002], [1000010, 10021], [1000001, 10100], [1000928, 11099], [1000700, 10007], [1000030, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[1000000, 100002], [1000010, 100023], [1000001, 100091], [1000928, 101909], [1000700, 110077], [1000030, 100003], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[1000000, 1000002], [1000010, 1000021], [1000001, 1000102], [1000928, 1001937], [1000700, 1010707], [1000030, 1100033], [1000033, 1000033], [10000019, 10000019], [100000007, 100000007]], [[1000000, 10000002], [1000010, 10000001], [1000001, 10000111], [1000928, 10000199], [1000700, 10017007], [1000030, 10100303], [1000033, 10000330], [10000019, 10000019], [100000007, 100000007]], [[1000000, 100000002], [1000010, 100000021], [1000001, 100000201], [1000928, 100000981], [1000700, 100039979], [1000030, 100103003], [1000033, 100003300], [10000019, 100000190], [100000007, 100000007]]], [[[10000000, 2], [10000001, 11], [10000010, 101], [10000199, 1009], [10007000, 10007], [10000300, 100003], [10000330, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10000000, 14], [10000001, 11], [10000010, 101], [10000199, 1009], [10007000, 10007], [10000300, 100003], [10000330, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10000000, 102], [10000001, 110], [10000010, 101], [10000199, 1009], [10007000, 10007], [10000300, 100003], [10000330, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10000000, 1002], [10000001, 1001], [10000010, 1111], [10000199, 1009], [10007000, 10007], [10000300, 100003], [10000330, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10000000, 10002], [10000001, 10010], [10000010, 10201], [10000199, 10090], [10007000, 10007], [10000300, 100003], [10000330, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10000000, 100002], [10000001, 100001], [10000010, 100091], [10000199, 100900], [10007000, 110077], [10000300, 100003], [10000330, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10000000, 1000002], [10000001, 1000010], [10000010, 1000203], [10000199, 1000928], [10007000, 1010707], [10000300, 1100033], [10000330, 1000033], [10000019, 10000019], [100000007, 100000007]], [[10000000, 10000002], [10000001, 10000012], [10000010, 10000111], [10000199, 10001208], [10007000, 10017007], [10000300, 10100303], [10000330, 11000363], [10000019, 10000019], [100000007, 100000007]], [[10000000, 100000002], [10000001, 100000021], [10000010, 100000201], [10000199, 100000981], [10007000, 100039979], [10000300, 100103003], [10000330, 101003333], [10000019, 100000190], [100000007, 100000007]]], [[[100000000, 2], [100000010, 11], [100000100, 101], [100000981, 1009], [100009958, 10007], [100003000, 100003], [100003300, 1000033], [100000190, 10000019], [100000007, 100000007]], [[100000000, 14], [100000010, 11], [100000100, 101], [100000981, 1009], [100009958, 10007], [100003000, 100003], [100003300, 1000033], [100000190, 10000019], [100000007, 100000007]], [[100000000, 102], [100000010, 121], [100000100, 101], [100000981, 1009], [100009958, 10007], [100003000, 100003], [100003300, 1000033], [100000190, 10000019], [100000007, 100000007]], [[100000000, 1002], [100000010, 1001], [100000100, 1111], [100000981, 1009], [100009958, 10007], [100003000, 100003], [100003300, 1000033], [100000190, 10000019], [100000007, 100000007]], [[100000000, 10002], [100000010, 10021], [100000100, 10201], [100000981, 10090], [100009958, 10007], [100003000, 100003], [100003300, 1000033], [100000190, 10000019], [100000007, 100000007]], [[100000000, 100002], [100000010, 100001], [100000100, 100091], [100000981, 100900], [100009958, 110077], [100003000, 100003], [100003300, 1000033], [100000190, 10000019], [100000007, 100000007]], [[100000000, 1000002], [100000010, 1000021], [100000100, 1000203], [100000981, 1000928], [100009958, 1010707], [100003000, 1100033], [100003300, 1000033], [100000190, 10000019], [100000007, 100000007]], [[100000000, 10000002], [100000010, 10000023], [100000100, 10000111], [100000981, 10000199], [100009958, 10017007], [100003000, 10100303], [100003300, 11000363], [100000190, 10000019], [100000007, 100000007]], [[100000000, 100000002], [100000010, 100000021], [100000100, 100000201], [100000981, 100001990], [100009958, 100019965], [100003000, 100103003], [100003300, 101003333], [100000190, 110000209], [100000007, 100000007]]]]
t = int(input())
for _ in range(t):
	solve()


from math import *
from collections import defaultdict as dt
from sys import stdin
inp = lambda : stdin.readline().strip()
I = lambda : int(inp())
M = lambda : map(int, stdin.readline().split())
L = lambda : list(map(int, stdin.readline().split()))
mod = 1000000009
inf = 100000000000000000000
ss = 'abcdefghijklmnopqrstuvwxyz'

def solve():
	(a, b, c) = M()
	a = 10 ** (a - 1)
	b = 10 ** (b - 1)
	c = 10 ** (c - 1)
	if a <= b:
		print(a, b + c)
	else:
		print(a + c, b)
tt = 1
tt = I()
for _ in range(tt):
	solve()


import sys

def get_ints():
	return list(map(int, sys.stdin.readline().strip().split()))
testcases = int(input())

def computeGCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
for testcase in range(testcases):
	arr = get_ints()
	a = arr[0]
	b = arr[1]
	c = arr[2]
	if a == 1 and b == 1 and (c == 1):
		print('1 1')
	if a == 1 and b == 2 and (c == 1):
		print('1 10')
	if a == 1 and b == 3 and (c == 1):
		print('1 100')
	if a == 1 and b == 4 and (c == 1):
		print('1 1000')
	if a == 1 and b == 5 and (c == 1):
		print('1 10000')
	if a == 1 and b == 6 and (c == 1):
		print('1 100000')
	if a == 1 and b == 7 and (c == 1):
		print('1 1000000')
	if a == 1 and b == 8 and (c == 1):
		print('1 10000000')
	if a == 1 and b == 9 and (c == 1):
		print('1 100000000')
	if a == 2 and b == 1 and (c == 1):
		print('10 1')
	if a == 2 and b == 2 and (c == 1):
		print('11 10')
	if a == 2 and b == 2 and (c == 2):
		print('10 10')
	if a == 2 and b == 3 and (c == 1):
		print('10 101')
	if a == 2 and b == 3 and (c == 2):
		print('10 100')
	if a == 2 and b == 4 and (c == 1):
		print('10 1001')
	if a == 2 and b == 4 and (c == 2):
		print('10 1000')
	if a == 2 and b == 5 and (c == 1):
		print('10 10001')
	if a == 2 and b == 5 and (c == 2):
		print('10 10000')
	if a == 2 and b == 6 and (c == 1):
		print('10 100001')
	if a == 2 and b == 6 and (c == 2):
		print('10 100000')
	if a == 2 and b == 7 and (c == 1):
		print('10 1000001')
	if a == 2 and b == 7 and (c == 2):
		print('10 1000000')
	if a == 2 and b == 8 and (c == 1):
		print('10 10000001')
	if a == 2 and b == 8 and (c == 2):
		print('10 10000000')
	if a == 2 and b == 9 and (c == 1):
		print('10 100000001')
	if a == 2 and b == 9 and (c == 2):
		print('10 100000000')
	if a == 3 and b == 1 and (c == 1):
		print('100 1')
	if a == 3 and b == 2 and (c == 1):
		print('101 10')
	if a == 3 and b == 2 and (c == 2):
		print('100 10')
	if a == 3 and b == 3 and (c == 1):
		print('101 100')
	if a == 3 and b == 3 and (c == 2):
		print('110 100')
	if a == 3 and b == 3 and (c == 3):
		print('100 100')
	if a == 3 and b == 4 and (c == 1):
		print('100 1001')
	if a == 3 and b == 4 and (c == 2):
		print('100 1010')
	if a == 3 and b == 4 and (c == 3):
		print('100 1000')
	if a == 3 and b == 5 and (c == 1):
		print('100 10001')
	if a == 3 and b == 5 and (c == 2):
		print('100 10010')
	if a == 3 and b == 5 and (c == 3):
		print('100 10000')
	if a == 3 and b == 6 and (c == 1):
		print('100 100001')
	if a == 3 and b == 6 and (c == 2):
		print('100 100010')
	if a == 3 and b == 6 and (c == 3):
		print('100 100000')
	if a == 3 and b == 7 and (c == 1):
		print('100 1000001')
	if a == 3 and b == 7 and (c == 2):
		print('100 1000010')
	if a == 3 and b == 7 and (c == 3):
		print('100 1000000')
	if a == 3 and b == 8 and (c == 1):
		print('100 10000001')
	if a == 3 and b == 8 and (c == 2):
		print('100 10000010')
	if a == 3 and b == 8 and (c == 3):
		print('100 10000000')
	if a == 3 and b == 9 and (c == 1):
		print('100 100000001')
	if a == 3 and b == 9 and (c == 2):
		print('100 100000010')
	if a == 3 and b == 9 and (c == 3):
		print('100 100000000')
	if a == 4 and b == 1 and (c == 1):
		print('1000 1')
	if a == 4 and b == 2 and (c == 1):
		print('1001 10')
	if a == 4 and b == 2 and (c == 2):
		print('1000 10')
	if a == 4 and b == 3 and (c == 1):
		print('1001 100')
	if a == 4 and b == 3 and (c == 2):
		print('1010 100')
	if a == 4 and b == 3 and (c == 3):
		print('1000 100')
	if a == 4 and b == 4 and (c == 1):
		print('1001 1000')
	if a == 4 and b == 4 and (c == 2):
		print('1010 1000')
	if a == 4 and b == 4 and (c == 3):
		print('1100 1000')
	if a == 4 and b == 4 and (c == 4):
		print('1000 1000')
	if a == 4 and b == 5 and (c == 1):
		print('1000 10001')
	if a == 4 and b == 5 and (c == 2):
		print('1000 10010')
	if a == 4 and b == 5 and (c == 3):
		print('1000 10100')
	if a == 4 and b == 5 and (c == 4):
		print('1000 10000')
	if a == 4 and b == 6 and (c == 1):
		print('1000 100001')
	if a == 4 and b == 6 and (c == 2):
		print('1000 100010')
	if a == 4 and b == 6 and (c == 3):
		print('1000 100100')
	if a == 4 and b == 6 and (c == 4):
		print('1000 100000')
	if a == 4 and b == 7 and (c == 1):
		print('1000 1000001')
	if a == 4 and b == 7 and (c == 2):
		print('1000 1000010')
	if a == 4 and b == 7 and (c == 3):
		print('1000 1000100')
	if a == 4 and b == 7 and (c == 4):
		print('1000 1000000')
	if a == 4 and b == 8 and (c == 1):
		print('1000 10000001')
	if a == 4 and b == 8 and (c == 2):
		print('1000 10000010')
	if a == 4 and b == 8 and (c == 3):
		print('1000 10000100')
	if a == 4 and b == 8 and (c == 4):
		print('1000 10000000')
	if a == 4 and b == 9 and (c == 1):
		print('1000 100000001')
	if a == 4 and b == 9 and (c == 2):
		print('1000 100000010')
	if a == 4 and b == 9 and (c == 3):
		print('1000 100000100')
	if a == 4 and b == 9 and (c == 4):
		print('1000 100000000')
	if a == 5 and b == 1 and (c == 1):
		print('10000 1')
	if a == 5 and b == 2 and (c == 1):
		print('10001 10')
	if a == 5 and b == 2 and (c == 2):
		print('10000 10')
	if a == 5 and b == 3 and (c == 1):
		print('10001 100')
	if a == 5 and b == 3 and (c == 2):
		print('10010 100')
	if a == 5 and b == 3 and (c == 3):
		print('10000 100')
	if a == 5 and b == 4 and (c == 1):
		print('10001 1000')
	if a == 5 and b == 4 and (c == 2):
		print('10010 1000')
	if a == 5 and b == 4 and (c == 3):
		print('10100 1000')
	if a == 5 and b == 4 and (c == 4):
		print('10000 1000')
	if a == 5 and b == 5 and (c == 1):
		print('10001 10000')
	if a == 5 and b == 5 and (c == 2):
		print('10010 10000')
	if a == 5 and b == 5 and (c == 3):
		print('10100 10000')
	if a == 5 and b == 5 and (c == 4):
		print('11000 10000')
	if a == 5 and b == 5 and (c == 5):
		print('10000 10000')
	if a == 5 and b == 6 and (c == 1):
		print('10000 100001')
	if a == 5 and b == 6 and (c == 2):
		print('10000 100010')
	if a == 5 and b == 6 and (c == 3):
		print('10000 100100')
	if a == 5 and b == 6 and (c == 4):
		print('10000 101000')
	if a == 5 and b == 6 and (c == 5):
		print('10000 100000')
	if a == 5 and b == 7 and (c == 1):
		print('10000 1000001')
	if a == 5 and b == 7 and (c == 2):
		print('10000 1000010')
	if a == 5 and b == 7 and (c == 3):
		print('10000 1000100')
	if a == 5 and b == 7 and (c == 4):
		print('10000 1001000')
	if a == 5 and b == 7 and (c == 5):
		print('10000 1000000')
	if a == 5 and b == 8 and (c == 1):
		print('10000 10000001')
	if a == 5 and b == 8 and (c == 2):
		print('10000 10000010')
	if a == 5 and b == 8 and (c == 3):
		print('10000 10000100')
	if a == 5 and b == 8 and (c == 4):
		print('10000 10001000')
	if a == 5 and b == 8 and (c == 5):
		print('10000 10000000')
	if a == 5 and b == 9 and (c == 1):
		print('10000 100000001')
	if a == 5 and b == 9 and (c == 2):
		print('10000 100000010')
	if a == 5 and b == 9 and (c == 3):
		print('10000 100000100')
	if a == 5 and b == 9 and (c == 4):
		print('10000 100001000')
	if a == 5 and b == 9 and (c == 5):
		print('10000 100000000')
	if a == 6 and b == 1 and (c == 1):
		print('100000 1')
	if a == 6 and b == 2 and (c == 1):
		print('100001 10')
	if a == 6 and b == 2 and (c == 2):
		print('100000 10')
	if a == 6 and b == 3 and (c == 1):
		print('100001 100')
	if a == 6 and b == 3 and (c == 2):
		print('100010 100')
	if a == 6 and b == 3 and (c == 3):
		print('100000 100')
	if a == 6 and b == 4 and (c == 1):
		print('100001 1000')
	if a == 6 and b == 4 and (c == 2):
		print('100010 1000')
	if a == 6 and b == 4 and (c == 3):
		print('100100 1000')
	if a == 6 and b == 4 and (c == 4):
		print('100000 1000')
	if a == 6 and b == 5 and (c == 1):
		print('100001 10000')
	if a == 6 and b == 5 and (c == 2):
		print('100010 10000')
	if a == 6 and b == 5 and (c == 3):
		print('100100 10000')
	if a == 6 and b == 5 and (c == 4):
		print('101000 10000')
	if a == 6 and b == 5 and (c == 5):
		print('100000 10000')
	if a == 6 and b == 6 and (c == 1):
		print('100001 100000')
	if a == 6 and b == 6 and (c == 2):
		print('100010 100000')
	if a == 6 and b == 6 and (c == 3):
		print('100100 100000')
	if a == 6 and b == 6 and (c == 4):
		print('101000 100000')
	if a == 6 and b == 6 and (c == 5):
		print('110000 100000')
	if a == 6 and b == 6 and (c == 6):
		print('100000 100000')
	if a == 6 and b == 7 and (c == 1):
		print('100000 1000001')
	if a == 6 and b == 7 and (c == 2):
		print('100000 1000010')
	if a == 6 and b == 7 and (c == 3):
		print('100000 1000100')
	if a == 6 and b == 7 and (c == 4):
		print('100000 1001000')
	if a == 6 and b == 7 and (c == 5):
		print('100000 1010000')
	if a == 6 and b == 7 and (c == 6):
		print('100000 1000000')
	if a == 6 and b == 8 and (c == 1):
		print('100000 10000001')
	if a == 6 and b == 8 and (c == 2):
		print('100000 10000010')
	if a == 6 and b == 8 and (c == 3):
		print('100000 10000100')
	if a == 6 and b == 8 and (c == 4):
		print('100000 10001000')
	if a == 6 and b == 8 and (c == 5):
		print('100000 10010000')
	if a == 6 and b == 8 and (c == 6):
		print('100000 10000000')
	if a == 6 and b == 9 and (c == 1):
		print('100000 100000001')
	if a == 6 and b == 9 and (c == 2):
		print('100000 100000010')
	if a == 6 and b == 9 and (c == 3):
		print('100000 100000100')
	if a == 6 and b == 9 and (c == 4):
		print('100000 100001000')
	if a == 6 and b == 9 and (c == 5):
		print('100000 100010000')
	if a == 6 and b == 9 and (c == 6):
		print('100000 100000000')
	if a == 7 and b == 1 and (c == 1):
		print('1000000 1')
	if a == 7 and b == 2 and (c == 1):
		print('1000001 10')
	if a == 7 and b == 2 and (c == 2):
		print('1000000 10')
	if a == 7 and b == 3 and (c == 1):
		print('1000001 100')
	if a == 7 and b == 3 and (c == 2):
		print('1000010 100')
	if a == 7 and b == 3 and (c == 3):
		print('1000000 100')
	if a == 7 and b == 4 and (c == 1):
		print('1000001 1000')
	if a == 7 and b == 4 and (c == 2):
		print('1000010 1000')
	if a == 7 and b == 4 and (c == 3):
		print('1000100 1000')
	if a == 7 and b == 4 and (c == 4):
		print('1000000 1000')
	if a == 7 and b == 5 and (c == 1):
		print('1000001 10000')
	if a == 7 and b == 5 and (c == 2):
		print('1000010 10000')
	if a == 7 and b == 5 and (c == 3):
		print('1000100 10000')
	if a == 7 and b == 5 and (c == 4):
		print('1001000 10000')
	if a == 7 and b == 5 and (c == 5):
		print('1000000 10000')
	if a == 7 and b == 6 and (c == 1):
		print('1000001 100000')
	if a == 7 and b == 6 and (c == 2):
		print('1000010 100000')
	if a == 7 and b == 6 and (c == 3):
		print('1000100 100000')
	if a == 7 and b == 6 and (c == 4):
		print('1001000 100000')
	if a == 7 and b == 6 and (c == 5):
		print('1010000 100000')
	if a == 7 and b == 6 and (c == 6):
		print('1000000 100000')
	if a == 7 and b == 7 and (c == 1):
		print('1000001 1000000')
	if a == 7 and b == 7 and (c == 2):
		print('1000010 1000000')
	if a == 7 and b == 7 and (c == 3):
		print('1000100 1000000')
	if a == 7 and b == 7 and (c == 4):
		print('1001000 1000000')
	if a == 7 and b == 7 and (c == 5):
		print('1010000 1000000')
	if a == 7 and b == 7 and (c == 6):
		print('1100000 1000000')
	if a == 7 and b == 7 and (c == 7):
		print('1000000 1000000')
	if a == 7 and b == 8 and (c == 1):
		print('1000000 10000001')
	if a == 7 and b == 8 and (c == 2):
		print('1000000 10000010')
	if a == 7 and b == 8 and (c == 3):
		print('1000000 10000100')
	if a == 7 and b == 8 and (c == 4):
		print('1000000 10001000')
	if a == 7 and b == 8 and (c == 5):
		print('1000000 10010000')
	if a == 7 and b == 8 and (c == 6):
		print('1000000 10100000')
	if a == 7 and b == 8 and (c == 7):
		print('1000000 10000000')
	if a == 7 and b == 9 and (c == 1):
		print('1000000 100000001')
	if a == 7 and b == 9 and (c == 2):
		print('1000000 100000010')
	if a == 7 and b == 9 and (c == 3):
		print('1000000 100000100')
	if a == 7 and b == 9 and (c == 4):
		print('1000000 100001000')
	if a == 7 and b == 9 and (c == 5):
		print('1000000 100010000')
	if a == 7 and b == 9 and (c == 6):
		print('1000000 100100000')
	if a == 7 and b == 9 and (c == 7):
		print('1000000 100000000')
	if a == 8 and b == 1 and (c == 1):
		print('10000000 1')
	if a == 8 and b == 2 and (c == 1):
		print('10000001 10')
	if a == 8 and b == 2 and (c == 2):
		print('10000000 10')
	if a == 8 and b == 3 and (c == 1):
		print('10000001 100')
	if a == 8 and b == 3 and (c == 2):
		print('10000010 100')
	if a == 8 and b == 3 and (c == 3):
		print('10000000 100')
	if a == 8 and b == 4 and (c == 1):
		print('10000001 1000')
	if a == 8 and b == 4 and (c == 2):
		print('10000010 1000')
	if a == 8 and b == 4 and (c == 3):
		print('10000100 1000')
	if a == 8 and b == 4 and (c == 4):
		print('10000000 1000')
	if a == 8 and b == 5 and (c == 1):
		print('10000001 10000')
	if a == 8 and b == 5 and (c == 2):
		print('10000010 10000')
	if a == 8 and b == 5 and (c == 3):
		print('10000100 10000')
	if a == 8 and b == 5 and (c == 4):
		print('10001000 10000')
	if a == 8 and b == 5 and (c == 5):
		print('10000000 10000')
	if a == 8 and b == 6 and (c == 1):
		print('10000001 100000')
	if a == 8 and b == 6 and (c == 2):
		print('10000010 100000')
	if a == 8 and b == 6 and (c == 3):
		print('10000100 100000')
	if a == 8 and b == 6 and (c == 4):
		print('10001000 100000')
	if a == 8 and b == 6 and (c == 5):
		print('10010000 100000')
	if a == 8 and b == 6 and (c == 6):
		print('10000000 100000')
	if a == 8 and b == 7 and (c == 1):
		print('10000001 1000000')
	if a == 8 and b == 7 and (c == 2):
		print('10000010 1000000')
	if a == 8 and b == 7 and (c == 3):
		print('10000100 1000000')
	if a == 8 and b == 7 and (c == 4):
		print('10001000 1000000')
	if a == 8 and b == 7 and (c == 5):
		print('10010000 1000000')
	if a == 8 and b == 7 and (c == 6):
		print('10100000 1000000')
	if a == 8 and b == 7 and (c == 7):
		print('10000000 1000000')
	if a == 8 and b == 8 and (c == 1):
		print('10000001 10000000')
	if a == 8 and b == 8 and (c == 2):
		print('10000010 10000000')
	if a == 8 and b == 8 and (c == 3):
		print('10000100 10000000')
	if a == 8 and b == 8 and (c == 4):
		print('10001000 10000000')
	if a == 8 and b == 8 and (c == 5):
		print('10010000 10000000')
	if a == 8 and b == 8 and (c == 6):
		print('10100000 10000000')
	if a == 8 and b == 8 and (c == 7):
		print('11000000 10000000')
	if a == 8 and b == 8 and (c == 8):
		print('10000000 10000000')
	if a == 8 and b == 9 and (c == 1):
		print('10000000 100000001')
	if a == 8 and b == 9 and (c == 2):
		print('10000000 100000010')
	if a == 8 and b == 9 and (c == 3):
		print('10000000 100000100')
	if a == 8 and b == 9 and (c == 4):
		print('10000000 100001000')
	if a == 8 and b == 9 and (c == 5):
		print('10000000 100010000')
	if a == 8 and b == 9 and (c == 6):
		print('10000000 100100000')
	if a == 8 and b == 9 and (c == 7):
		print('10000000 101000000')
	if a == 8 and b == 9 and (c == 8):
		print('10000000 100000000')
	if a == 9 and b == 1 and (c == 1):
		print('100000000 1')
	if a == 9 and b == 2 and (c == 1):
		print('100000001 10')
	if a == 9 and b == 2 and (c == 2):
		print('100000000 10')
	if a == 9 and b == 3 and (c == 1):
		print('100000001 100')
	if a == 9 and b == 3 and (c == 2):
		print('100000010 100')
	if a == 9 and b == 3 and (c == 3):
		print('100000000 100')
	if a == 9 and b == 4 and (c == 1):
		print('100000001 1000')
	if a == 9 and b == 4 and (c == 2):
		print('100000010 1000')
	if a == 9 and b == 4 and (c == 3):
		print('100000100 1000')
	if a == 9 and b == 4 and (c == 4):
		print('100000000 1000')
	if a == 9 and b == 5 and (c == 1):
		print('100000001 10000')
	if a == 9 and b == 5 and (c == 2):
		print('100000010 10000')
	if a == 9 and b == 5 and (c == 3):
		print('100000100 10000')
	if a == 9 and b == 5 and (c == 4):
		print('100001000 10000')
	if a == 9 and b == 5 and (c == 5):
		print('100000000 10000')
	if a == 9 and b == 6 and (c == 1):
		print('100000001 100000')
	if a == 9 and b == 6 and (c == 2):
		print('100000010 100000')
	if a == 9 and b == 6 and (c == 3):
		print('100000100 100000')
	if a == 9 and b == 6 and (c == 4):
		print('100001000 100000')
	if a == 9 and b == 6 and (c == 5):
		print('100010000 100000')
	if a == 9 and b == 6 and (c == 6):
		print('100000000 100000')
	if a == 9 and b == 7 and (c == 1):
		print('100000001 1000000')
	if a == 9 and b == 7 and (c == 2):
		print('100000010 1000000')
	if a == 9 and b == 7 and (c == 3):
		print('100000100 1000000')
	if a == 9 and b == 7 and (c == 4):
		print('100001000 1000000')
	if a == 9 and b == 7 and (c == 5):
		print('100010000 1000000')
	if a == 9 and b == 7 and (c == 6):
		print('100100000 1000000')
	if a == 9 and b == 7 and (c == 7):
		print('100000000 1000000')
	if a == 9 and b == 8 and (c == 1):
		print('100000001 10000000')
	if a == 9 and b == 8 and (c == 2):
		print('100000010 10000000')
	if a == 9 and b == 8 and (c == 3):
		print('100000100 10000000')
	if a == 9 and b == 8 and (c == 4):
		print('100001000 10000000')
	if a == 9 and b == 8 and (c == 5):
		print('100010000 10000000')
	if a == 9 and b == 8 and (c == 6):
		print('100100000 10000000')
	if a == 9 and b == 8 and (c == 7):
		print('101000000 10000000')
	if a == 9 and b == 8 and (c == 8):
		print('100000000 10000000')
	if a == 9 and b == 9 and (c == 1):
		print('100000001 100000000')
	if a == 9 and b == 9 and (c == 2):
		print('100000010 100000000')
	if a == 9 and b == 9 and (c == 3):
		print('100000100 100000000')
	if a == 9 and b == 9 and (c == 4):
		print('100001000 100000000')
	if a == 9 and b == 9 and (c == 5):
		print('100010000 100000000')
	if a == 9 and b == 9 and (c == 6):
		print('100100000 100000000')
	if a == 9 and b == 9 and (c == 7):
		print('101000000 100000000')
	if a == 9 and b == 9 and (c == 8):
		print('110000000 100000000')
	if a == 9 and b == 9 and (c == 9):
		print('100000000 100000000')


t = int(input())

def gcd(m, n):
	while n:
		(m, n) = (n, m % n)
	return m

def extgcd(a, b):
	if b == 0:
		return (1, 0)
	else:
		(x, y) = extgcd(b, a % b)
		return (y, x - a // b * y)
while t:
	(a, b, c) = list(map(int, input().split()))
	m = a - c
	n = b - c
	if m < n:
		ans2 = 10 ** n
		for ans1 in range(10 ** m, 10 ** (m + 1)):
			if gcd(ans1, ans2) == 1:
				print(ans1 * 10 ** (c - 1), ans2 * 10 ** (c - 1))
				break
	else:
		ans1 = 10 ** m
		for ans2 in range(10 ** n, 10 ** (n + 1)):
			if gcd(ans1, ans2) == 1:
				print(ans1 * 10 ** (c - 1), ans2 * 10 ** (c - 1))
				break
	t -= 1


import sys

def solve(a, b, c):
	pa = [2, 11, 101, 1009, 10007, 100003, 1000003, 10000019, 100000007]
	pb = [3, 13, 103, 1013, 10009, 100019, 1000033, 10000079, 100000037]
	nc = 2 * 10 ** (c - 1)
	na = nc * pa[a - c]
	nb = nc * pb[b - c]
	print(na, nb)
	sys.stdout.flush()
T = int(input())
for t in range(T):
	(a, b, c) = map(int, input().split())
	solve(a, b, c)


import sys
pin = sys.stdin.readline
for T in range(int(pin())):
	(A, B, C) = map(int, pin().split())
	print(11 ** (A - C) * 10 ** (C - 1), 10 ** (B - 1))


from sys import stdin, stdout
from os import path
rd = lambda : stdin.readline().strip()
wr = stdout.write
if path.exists('input.txt'):
	stdin = open('input.txt', 'r')
import time, math
for _ in range(int(rd())):
	(a, b, c) = map(int, rd().split())
	x = pow(10, a - 1)
	y = pow(10, c - 1) * (pow(10, b - c) + 1)
	print(x, y)


def isPrime(n):
	if n == 0 or n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True
t = int(input())
for _t in range(t):
	(a, b, c) = [int(e) for e in input().strip().split()]
	(base, x, y) = (None, None, None)
	for i in range(10 ** (c - 1), 10 ** c):
		if isPrime(i):
			base = i
			break
	for i in range(10 ** (a - c), 10 ** (a - c + 1)):
		if isPrime(i):
			x = base * i
			break
	sameDigFlag = a == b
	for i in range(10 ** (b - c), 10 ** (b - c + 1)):
		if isPrime(i):
			if sameDigFlag:
				sameDigFlag = False
			else:
				y = base * i
				break
	print(x, y)


from math import gcd as g
t = int(input())
for i in range(t):
	(a, b, c) = list(map(int, input().split()))
	am = 10 ** a - 1
	bm = 10 ** b - 1
	cm = 10 ** c - 1
	ax = 10 ** (a - 1)
	bx = 10 ** (b - 1)
	cx = 10 ** (c - 1)
	m = 0
	if a == b and b == c:
		print(am, bm)
	elif c == 1:
		if a > b:
			print(bm * 10 ** (a - b) + 1, bm)
		elif b > a:
			print(am, am * 10 ** (b - a) + 1)
		else:
			print(am, am - 1)
	elif a > b:
		if b != c:
			print(ax, bx + cx)
		else:
			print(ax, bx)
	elif a != c:
		print(ax + cx, bx)
	else:
		print(ax, bx)


import sys

def inpu():
	return sys.stdin.buffer.readline().strip()
T = int(input())
k = [1, 11, 101, 1009, 10007, 100003, 1000003, 10000019, 100000007]
k2 = [2, 13, 103, 1013, 10009, 100019, 1000033, 10000169, 100000049]
for t in range(T):
	(a, b, c) = map(int, input().split())
	done = False
	print(k[c - 1] * k[a - c], k[c - 1] * k2[b - c])


import os
from io import BytesIO, IOBase
import sys
import math

def main():
	for i in range(int(input())):
		(a, b, c) = map(int, input().split())
		a1 = 1
		b1 = 1
		c1 = 1
		while len(str(c1)) < c:
			c1 = c1 * 2
			a1 = a1 * 2
			b1 = b1 * 2
		while len(str(b1)) < b:
			b1 = b1 * 5
		while len(str(a1)) < a:
			a1 = a1 * 3
		print(a1, b1)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from __future__ import division, print_function
import os, sys
import math
import collections
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

class my_dictionary(dict):

	def __init__(self):
		self = dict()

	def add(self, key, value):
		self[key] = value

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def sli():
	return list(msi())

def dmain():
	sys.setrecursionlimit(100000000)
	threading.stack_size(40960000)
	thread = threading.Thread(target=main)
	thread.start()
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[1]

def sort2(l):
	return sorted(l, key=getKey, reverse=True)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def factorial(n):
	return 1 if n == 1 or n == 0 else n * factorial(n - 1)

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(n - r))

def binary_search(arr, low, high, x):
	if high >= low:
		mid = (high + low) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] > x:
			return binary_search(arr, low, mid - 1, x)
		else:
			return binary_search(arr, mid + 1, high, x)
	else:
		return -1

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def nCr(n, r):
	return fact(n) / (fact(r) * fact(n - r))

def fact(n):
	res = 1
	for i in range(2, n + 1):
		res = res * i
	return res

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def padded_bin_with_complement(x):
	if x < 0:
		return bin(2 ** 16 - abs(x))[2:].zfill(16)
	else:
		return bin(x)[2:].zfill(16)

def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal

def CountFrequency(my_list):
	freq = {}
	for item in my_list:
		if item in freq:
			freq[item] += 1
		else:
			freq[item] = 1
	return freq

def pos(a):
	b = [0] * len(a)
	c = sorted(a)
	for i in range(len(a)):
		for j in range(len(a)):
			if c[j] == a[i]:
				b[i] = j
				break
	return b

def smallestDivisor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n

def commonn(a, b, n):
	c = []
	for i in range(n):
		if a[i] == b[i]:
			c.append('-1')
		else:
			c.append(b[i])
	return c

def find_lcm(num1, num2):
	if num1 > num2:
		num = num1
		den = num2
	else:
		num = num2
		den = num1
	rem = num % den
	while rem != 0:
		num = den
		den = rem
		rem = num % den
	gcd = den
	lcm = int(int(num1 * num2) / int(gcd))
	return lcm

def sumdigit(n):
	n = str(n)
	k = 0
	for i in range(len(n)):
		k += int(n[i])
	return k

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z
from itertools import permutations

def main():
	for _ in range(ii()):
		(a, b, c) = mi()
		a1 = 10 ** (a - 1)
		b1 = 10 ** (b - 1)
		c1 = 10 ** (c - 1)
		print(a1 + c1, b1)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import math
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	s = '1'
	for i in range(1, a):
		s = s + '0'
	s1 = '1'
	for i in range(1, b):
		s1 = s1 + '0'
	s2 = '1'
	for i in range(1, c):
		s2 = s2 + '0'
	if a == b == c:
		print(s, end=' ')
		print(s1)
	elif a == b:
		s1 = int(s1) + int(s2)
		print(s, s1)
	elif a > b:
		if b == c:
			print(s, s1)
		else:
			s1 = int(s1) + int(s2)
			print(s, s1)
	elif a < b:
		if a == c:
			print(s, s1)
		else:
			s = int(s) + int(s2)
			print(s, s1)


ans = [[[0] * 10 for i in range(10)] for j in range(10)]
ans[1][1][1] = (1, 1)
ans[1][2][1] = (1, 10)
ans[1][3][1] = (1, 100)
ans[1][4][1] = (1, 1000)
ans[1][5][1] = (1, 10000)
ans[1][6][1] = (1, 100000)
ans[1][7][1] = (1, 1000000)
ans[1][8][1] = (1, 10000000)
ans[1][9][1] = (1, 100000000)
ans[2][1][1] = (10, 1)
ans[2][2][1] = (10, 11)
ans[2][2][2] = (10, 10)
ans[2][3][1] = (10, 111)
ans[2][3][2] = (10, 100)
ans[2][4][1] = (10, 1111)
ans[2][4][2] = (10, 1000)
ans[2][5][1] = (10, 11111)
ans[2][5][2] = (10, 10000)
ans[2][6][1] = (10, 111111)
ans[2][6][2] = (10, 100000)
ans[2][7][1] = (10, 1111111)
ans[2][7][2] = (10, 1000000)
ans[2][8][1] = (10, 11111111)
ans[2][8][2] = (10, 10000000)
ans[2][9][1] = (10, 111111111)
ans[2][9][2] = (10, 100000000)
ans[3][1][1] = (100, 1)
ans[3][2][1] = (100, 11)
ans[3][2][2] = (100, 10)
ans[3][3][1] = (100, 111)
ans[3][3][2] = (100, 110)
ans[3][3][3] = (100, 100)
ans[3][4][1] = (100, 1111)
ans[3][4][2] = (100, 1110)
ans[3][4][3] = (100, 1000)
ans[3][5][1] = (100, 11111)
ans[3][5][2] = (100, 11110)
ans[3][5][3] = (100, 10000)
ans[3][6][1] = (100, 111111)
ans[3][6][2] = (100, 111110)
ans[3][6][3] = (100, 100000)
ans[3][7][1] = (100, 1111111)
ans[3][7][2] = (100, 1111110)
ans[3][7][3] = (100, 1000000)
ans[3][8][1] = (100, 11111111)
ans[3][8][2] = (100, 11111110)
ans[3][8][3] = (100, 10000000)
ans[3][9][1] = (100, 111111111)
ans[3][9][2] = (100, 111111110)
ans[3][9][3] = (100, 100000000)
ans[4][1][1] = (1000, 1)
ans[4][2][1] = (1000, 11)
ans[4][2][2] = (1000, 10)
ans[4][3][1] = (1000, 111)
ans[4][3][2] = (1000, 110)
ans[4][3][3] = (1000, 100)
ans[4][4][1] = (1000, 1111)
ans[4][4][2] = (1000, 1110)
ans[4][4][3] = (1000, 1100)
ans[4][4][4] = (1000, 1000)
ans[4][5][1] = (1000, 11111)
ans[4][5][2] = (1000, 11110)
ans[4][5][3] = (1000, 11100)
ans[4][5][4] = (1000, 10000)
ans[4][6][1] = (1000, 111111)
ans[4][6][2] = (1000, 111110)
ans[4][6][3] = (1000, 111100)
ans[4][6][4] = (1000, 100000)
ans[4][7][1] = (1000, 1111111)
ans[4][7][2] = (1000, 1111110)
ans[4][7][3] = (1000, 1111100)
ans[4][7][4] = (1000, 1000000)
ans[4][8][1] = (1000, 11111111)
ans[4][8][2] = (1000, 11111110)
ans[4][8][3] = (1000, 11111100)
ans[4][8][4] = (1000, 10000000)
ans[4][9][1] = (1000, 111111111)
ans[4][9][2] = (1000, 111111110)
ans[4][9][3] = (1000, 111111100)
ans[4][9][4] = (1000, 100000000)
ans[5][1][1] = (10000, 1)
ans[5][2][1] = (10000, 11)
ans[5][2][2] = (10000, 10)
ans[5][3][1] = (10000, 111)
ans[5][3][2] = (10000, 110)
ans[5][3][3] = (10000, 100)
ans[5][4][1] = (10000, 1111)
ans[5][4][2] = (10000, 1110)
ans[5][4][3] = (10000, 1100)
ans[5][4][4] = (10000, 1000)
ans[5][5][1] = (10000, 11111)
ans[5][5][2] = (10000, 11110)
ans[5][5][3] = (10000, 11100)
ans[5][5][4] = (10000, 11000)
ans[5][5][5] = (10000, 10000)
ans[5][6][1] = (10000, 111111)
ans[5][6][2] = (10000, 111110)
ans[5][6][3] = (10000, 111100)
ans[5][6][4] = (10000, 111000)
ans[5][6][5] = (10000, 100000)
ans[5][7][1] = (10000, 1111111)
ans[5][7][2] = (10000, 1111110)
ans[5][7][3] = (10000, 1111100)
ans[5][7][4] = (10000, 1111000)
ans[5][7][5] = (10000, 1000000)
ans[5][8][1] = (10000, 11111111)
ans[5][8][2] = (10000, 11111110)
ans[5][8][3] = (10000, 11111100)
ans[5][8][4] = (10000, 11111000)
ans[5][8][5] = (10000, 10000000)
ans[5][9][1] = (10000, 111111111)
ans[5][9][2] = (10000, 111111110)
ans[5][9][3] = (10000, 111111100)
ans[5][9][4] = (10000, 111111000)
ans[5][9][5] = (10000, 100000000)
ans[6][1][1] = (100000, 1)
ans[6][2][1] = (100000, 11)
ans[6][2][2] = (100000, 10)
ans[6][3][1] = (100000, 111)
ans[6][3][2] = (100000, 110)
ans[6][3][3] = (100000, 100)
ans[6][4][1] = (100000, 1111)
ans[6][4][2] = (100000, 1110)
ans[6][4][3] = (100000, 1100)
ans[6][4][4] = (100000, 1000)
ans[6][5][1] = (100000, 11111)
ans[6][5][2] = (100000, 11110)
ans[6][5][3] = (100000, 11100)
ans[6][5][4] = (100000, 11000)
ans[6][5][5] = (100000, 10000)
ans[6][6][1] = (100000, 111111)
ans[6][6][2] = (100000, 111110)
ans[6][6][3] = (100000, 111100)
ans[6][6][4] = (100000, 111000)
ans[6][6][5] = (100000, 110000)
ans[6][6][6] = (100000, 100000)
ans[6][7][1] = (100000, 1111111)
ans[6][7][2] = (100000, 1111110)
ans[6][7][3] = (100000, 1111100)
ans[6][7][4] = (100000, 1111000)
ans[6][7][5] = (100000, 1110000)
ans[6][7][6] = (100000, 1000000)
ans[6][8][1] = (100000, 11111111)
ans[6][8][2] = (100000, 11111110)
ans[6][8][3] = (100000, 11111100)
ans[6][8][4] = (100000, 11111000)
ans[6][8][5] = (100000, 11110000)
ans[6][8][6] = (100000, 10000000)
ans[6][9][1] = (100000, 111111111)
ans[6][9][2] = (100000, 111111110)
ans[6][9][3] = (100000, 111111100)
ans[6][9][4] = (100000, 111111000)
ans[6][9][5] = (100000, 111110000)
ans[6][9][6] = (100000, 100000000)
ans[7][1][1] = (1000000, 1)
ans[7][2][1] = (1000000, 11)
ans[7][2][2] = (1000000, 10)
ans[7][3][1] = (1000000, 111)
ans[7][3][2] = (1000000, 110)
ans[7][3][3] = (1000000, 100)
ans[7][4][1] = (1000000, 1111)
ans[7][4][2] = (1000000, 1110)
ans[7][4][3] = (1000000, 1100)
ans[7][4][4] = (1000000, 1000)
ans[7][5][1] = (1000000, 11111)
ans[7][5][2] = (1000000, 11110)
ans[7][5][3] = (1000000, 11100)
ans[7][5][4] = (1000000, 11000)
ans[7][5][5] = (1000000, 10000)
ans[7][6][1] = (1000000, 111111)
ans[7][6][2] = (1000000, 111110)
ans[7][6][3] = (1000000, 111100)
ans[7][6][4] = (1000000, 111000)
ans[7][6][5] = (1000000, 110000)
ans[7][6][6] = (1000000, 100000)
ans[7][7][1] = (1000000, 1111111)
ans[7][7][2] = (1000000, 1111110)
ans[7][7][3] = (1000000, 1111100)
ans[7][7][4] = (1000000, 1111000)
ans[7][7][5] = (1000000, 1110000)
ans[7][7][6] = (1000000, 1100000)
ans[7][7][7] = (1000000, 1000000)
ans[7][8][1] = (1000000, 11111111)
ans[7][8][2] = (1000000, 11111110)
ans[7][8][3] = (1000000, 11111100)
ans[7][8][4] = (1000000, 11111000)
ans[7][8][5] = (1000000, 11110000)
ans[7][8][6] = (1000000, 11100000)
ans[7][8][7] = (1000000, 10000000)
ans[7][9][1] = (1000000, 111111111)
ans[7][9][2] = (1000000, 111111110)
ans[7][9][3] = (1000000, 111111100)
ans[7][9][4] = (1000000, 111111000)
ans[7][9][5] = (1000000, 111110000)
ans[7][9][6] = (1000000, 111100000)
ans[7][9][7] = (1000000, 100000000)
ans[8][1][1] = (10000000, 1)
ans[8][2][1] = (10000000, 11)
ans[8][2][2] = (10000000, 10)
ans[8][3][1] = (10000000, 111)
ans[8][3][2] = (10000000, 110)
ans[8][3][3] = (10000000, 100)
ans[8][4][1] = (10000000, 1111)
ans[8][4][2] = (10000000, 1110)
ans[8][4][3] = (10000000, 1100)
ans[8][4][4] = (10000000, 1000)
ans[8][5][1] = (10000000, 11111)
ans[8][5][2] = (10000000, 11110)
ans[8][5][3] = (10000000, 11100)
ans[8][5][4] = (10000000, 11000)
ans[8][5][5] = (10000000, 10000)
ans[8][6][1] = (10000000, 111111)
ans[8][6][2] = (10000000, 111110)
ans[8][6][3] = (10000000, 111100)
ans[8][6][4] = (10000000, 111000)
ans[8][6][5] = (10000000, 110000)
ans[8][6][6] = (10000000, 100000)
ans[8][7][1] = (10000000, 1111111)
ans[8][7][2] = (10000000, 1111110)
ans[8][7][3] = (10000000, 1111100)
ans[8][7][4] = (10000000, 1111000)
ans[8][7][5] = (10000000, 1110000)
ans[8][7][6] = (10000000, 1100000)
ans[8][7][7] = (10000000, 1000000)
ans[8][8][1] = (10000000, 11111111)
ans[8][8][2] = (10000000, 11111110)
ans[8][8][3] = (10000000, 11111100)
ans[8][8][4] = (10000000, 11111000)
ans[8][8][5] = (10000000, 11110000)
ans[8][8][6] = (10000000, 11100000)
ans[8][8][7] = (10000000, 11000000)
ans[8][8][8] = (10000000, 10000000)
ans[8][9][1] = (10000000, 111111111)
ans[8][9][2] = (10000000, 111111110)
ans[8][9][3] = (10000000, 111111100)
ans[8][9][4] = (10000000, 111111000)
ans[8][9][5] = (10000000, 111110000)
ans[8][9][6] = (10000000, 111100000)
ans[8][9][7] = (10000000, 111000000)
ans[8][9][8] = (10000000, 100000000)
ans[9][1][1] = (100000000, 1)
ans[9][2][1] = (100000000, 11)
ans[9][2][2] = (100000000, 10)
ans[9][3][1] = (100000000, 111)
ans[9][3][2] = (100000000, 110)
ans[9][3][3] = (100000000, 100)
ans[9][4][1] = (100000000, 1111)
ans[9][4][2] = (100000000, 1110)
ans[9][4][3] = (100000000, 1100)
ans[9][4][4] = (100000000, 1000)
ans[9][5][1] = (100000000, 11111)
ans[9][5][2] = (100000000, 11110)
ans[9][5][3] = (100000000, 11100)
ans[9][5][4] = (100000000, 11000)
ans[9][5][5] = (100000000, 10000)
ans[9][6][1] = (100000000, 111111)
ans[9][6][2] = (100000000, 111110)
ans[9][6][3] = (100000000, 111100)
ans[9][6][4] = (100000000, 111000)
ans[9][6][5] = (100000000, 110000)
ans[9][6][6] = (100000000, 100000)
ans[9][7][1] = (100000000, 1111111)
ans[9][7][2] = (100000000, 1111110)
ans[9][7][3] = (100000000, 1111100)
ans[9][7][4] = (100000000, 1111000)
ans[9][7][5] = (100000000, 1110000)
ans[9][7][6] = (100000000, 1100000)
ans[9][7][7] = (100000000, 1000000)
ans[9][8][1] = (100000000, 11111111)
ans[9][8][2] = (100000000, 11111110)
ans[9][8][3] = (100000000, 11111100)
ans[9][8][4] = (100000000, 11111000)
ans[9][8][5] = (100000000, 11110000)
ans[9][8][6] = (100000000, 11100000)
ans[9][8][7] = (100000000, 11000000)
ans[9][8][8] = (100000000, 10000000)
ans[9][9][1] = (100000000, 111111111)
ans[9][9][2] = (100000000, 111111110)
ans[9][9][3] = (100000000, 111111100)
ans[9][9][4] = (100000000, 111111000)
ans[9][9][5] = (100000000, 111110000)
ans[9][9][6] = (100000000, 111100000)
ans[9][9][7] = (100000000, 111000000)
ans[9][9][8] = (100000000, 110000000)
ans[9][9][9] = (100000000, 100000000)
for tt in range(int(input())):
	(a, b, c) = map(int, input().split())
	print(*ans[a][b][c])


from sys import stdin, stdout
input = stdin.readline

def main():
	t = int(input())
	for z in range(t):
		(a, b, c) = map(int, input().split())
		a = 10 ** (a - 1)
		b = int('1' * (b - c + 1)) * 10 ** (c - 1)
		c = 10 ** (c - 1)
		print(a, b)
main()


for ttt in range(int(input())):
	(a, b, c) = map(int, input().split())
	arr = [0, 3, 11, 101, 1009, 10009, 100003, 1000003, 10000019, 999999937]
	ans1 = arr[c]
	while 1:
		if len(str(ans1)) == a:
			break
		ans1 *= 2
	ans2 = arr[c]
	while 1:
		if len(str(ans2)) == b:
			break
		ans2 *= 3
	print(ans1, ans2)


def countDigit(n):
	count = 0
	while n != 0:
		n //= 10
		count += 1
	return count
from math import gcd as g
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	if a == b and b == c:
		A = B = 10 ** (a - 1)
		print(A, B)
	else:
		flag = False
		i = 10 ** (a - 1)
		j = 10 ** (b - 1)
		while i < 10 ** a:
			while j < 10 ** b:
				if c == countDigit(g(i, j)):
					A = i
					B = j
					flag = True
					break
				j += 10 ** (c - 1)
			if flag:
				break
			i += 10 ** (c - 1)
		print(A, B)


import sys

def I():
	return int(sys.stdin.readline().rstrip())

def MI():
	return map(int, sys.stdin.readline().rstrip().split())

def LI():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def LI2():
	return list(map(int, sys.stdin.readline().rstrip()))

def S():
	return sys.stdin.readline().rstrip()

def LS():
	return list(sys.stdin.readline().rstrip().split())

def LS2():
	return list(sys.stdin.readline().rstrip())
t = I()
for _ in range(t):
	(a, b, c) = MI()
	if a >= b:
		x = 10 ** (a - 1) + 10 ** (c - 1)
		y = 10 ** (b - 1)
	else:
		x = 10 ** (a - 1)
		y = 10 ** (b - 1) + 10 ** (c - 1)
	print(x, y)


import os.path
import sys

def st():
	return list(sys.stdin.readline().strip())

def li():
	return list(map(int, sys.stdin.readline().split()))

def mp():
	return map(int, sys.stdin.readline().split())

def inp():
	return int(sys.stdin.readline())

def pr(n):
	return sys.stdout.write(str(n) + '\n')

def prl(n):
	return sys.stdout.write(str(n) + ' ')
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def solve():
	(a, b, c) = mp()
	gcd_a = 10 ** (a - 1)
	gcd_b = 10 ** (b - 1)
	gcd_c = 10 ** (c - 1)
	prl(gcd_a + gcd_c)
	pr(gcd_b)
for _ in range(inp()):
	solve()


primes1 = [2, 11, 101, 1009, 10007]
primes2 = [3, 13, 103, 1013, 10009]

def get(primes, a):
	if a < 1:
		return 1
	elif a < 5:
		return primes[a]
	elif a < 8:
		return primes[a - 4] * primes[4]
	elif a < 10:
		return primes[4] * primes[3] * primes[a - 7]
	elif a == 10:
		return primes[4] * primes[3] * primes[2] * primes[1]
	else:
		raise ValueError
T = int(input())
for _ in range(T):
	(a, b, c) = map(int, input().split())
	base = 10 ** (c - 1)
	x = get(primes1, a - c) * base
	y = get(primes2, b - c) * base
	print(x, y)


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	x = '1' + '0' * (a - 1)
	y = '1' * (b - c + 1) + '0' * (c - 1)
	print(x, y)


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	g = 7
	while len(str(g)) < c:
		g *= 7
	assert len(str(g)) == c
	x = g
	y = g
	while len(str(x)) < a:
		x *= 2
	while len(str(y)) < b:
		y *= 3
	assert len(str(x)) == a
	assert len(str(y)) == b
	print(x, y)


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	if a == b == c == 1:
		print(1, 1)
	elif c == 1:
		if a == 1:
			print(3, pow(10, b - 1))
		elif b == 1:
			print(pow(10, a - 1), 3)
		else:
			print(pow(10, a - 1) + 1, pow(10, b - 1))
	else:
		r1 = int('1' + '0' * (c - 1))
		rx = int('1' + '0' * (a - 1)) + r1
		ry = int('1' + '0' * (b - 1))
		print(rx, ry)


t = int(input())
for test in range(t):
	(a, b, c) = map(int, input().split())
	aa = '1' + '0' * (a - 1)
	bb = '1' * (b - c + 1) + '0' * (c - 1)
	print(aa, bb)


import sys
lines = sys.stdin.readlines()
cur_line = -1

def input():
	global lines, cur_line
	cur_line += 1
	return lines[cur_line][:-1]

def is_prime(i):
	if i % 2 == 0:
		return False
	t = 3
	while t * t <= i:
		if i % t == 0:
			return False
		t += 2
	return True
p = [list(filter(is_prime, range(3, 10))), list(filter(is_prime, range(10, 100))), list(filter(is_prime, range(100, 300))), list(filter(is_prime, range(1000, 1000 + 100))), list(filter(is_prime, range(10000, 10000 + 100))), list(filter(is_prime, range(100000, 100000 + 100))), list(filter(is_prime, range(1000000, 1000000 + 100))), list(filter(is_prime, range(10000000, 10000000 + 100))), list(filter(is_prime, range(100000000, 100000000 + 100))), list(filter(is_prime, range(1000000000, 1000000000 + 100)))]
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	d = 10 ** (c - 1)
	print(d * p[a - c][0], d * p[b - c][1])


import sys
input = sys.stdin.readline

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True

def main():
	t = int(input())
	primes = [[] for j in range(20)]
	for i in range(10):
		count = 0
		for j in range(10 ** i, 10 ** (i + 1)):
			if is_prime(j):
				primes[i + 1].append(j)
				count += 1
			if count == 3:
				break
	primes[1][2] = 1
	for _ in range(t):
		(A, B, C) = [int(x) for x in input().split()]
		diff_a = A - C + 1
		diff_b = B - C + 1
		c_value = primes[C][0]
		a_value = c_value * primes[diff_a][1]
		b_value = c_value * primes[diff_b][2]
		print(a_value, b_value)
main()


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	x = 10 ** (a - 1)
	y = 10 ** (b - 1)
	if y <= x:
		if b != c:
			y += 10 ** (c - 1)
	elif a != c:
		x += 10 ** (c - 1)
	print(x, y)


import math
from collections import defaultdict
from sys import stdin
input = stdin.readline
T = int(input())
for _ in range(T):
	(a, b, c) = map(int, input().split())
	if a <= b:
		y = '1'
		for i in range(b - 1):
			y += '0'
		y = int(y)
		x = '1'
		for i in range(a - 1):
			x += '0'
		x = list(x)
		x[-c] = '1'
		p = ''
		x = p.join(x)
		x = int(x)
		print(x, y)
	else:
		x = '1'
		for i in range(a - 1):
			x += '0'
		x = int(x)
		y = '1'
		for i in range(b - 1):
			y += '0'
		y = list(y)
		y[-c] = '1'
		p = ''
		y = p.join(y)
		y = int(y)
		print(x, y)


for _ in [0] * int(input()):
	(a, b, c) = map(int, input().split())
	print(10 ** (a - 1), 10 ** (c - 1) * 9 ** (b - c + 1))


T = int(input())
while T > 0:
	(a, b, c) = [int(x) for x in input().split()]
	gc = 1 * pow(10, c - 1)
	num1 = 1 * pow(10, a - 1)
	num2 = 1 * pow(10, b - 1) + gc
	print(num1, num2)
	T -= 1


t = int(input())
for xr in range(t):
	(a, b, c) = map(int, input().split())
	if min(a, b) == c:
		print(10 ** (a - 1), 10 ** (b - 1))
	else:
		t1 = 10 ** (c - 1)
		t2 = t1
		while len(str(t1)) < a:
			t1 *= 7
		while len(str(t2)) < b:
			t2 *= 9
		print(t1, t2)


for t in range(int(input())):
	(a, b, c) = map(int, input().split())
	p = 10 ** (a - 1)
	h = 10 ** (b - 1) + 10 ** (c - 1)
	print(p, h)


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	(l, m, n) = (10 ** (a - 1), 10 ** (b - 1), 10 ** (c - 1))
	if l < m:
		m += n
	else:
		l += n
	print(l, m)


T = int(input())
import math

def solve():
	types = list(map(int, input().split()))
	a = types[0]
	b = types[1]
	c = types[2]
	range_gcd = [10 * (c - 1), 10 * c - 1]
	range_a = [10 * (a - 1), 10 * a - 1]
	range_b = [10 * (b - 1), 10 * b - 1]
	for gcd in range(10 ** (c - 1), 10 ** c):
		for q in range(int(10 ** (a - 1) / gcd), int(10 ** a / gcd)):
			x = gcd * q
			for r in range(int(10 ** (b - 1) / gcd), int(10 ** b / gcd)):
				if math.gcd(q, r) == 1:
					y = gcd * r
					return [x, y]
	return [1, 1]
for i in range(T):
	ans = solve()
	texto = ''
	for number in ans:
		texto += str(number) + ' '
	print(texto[:-1])


def findGCD(x, y):
	f = y
	g = x % y
	return f if not g else findGCD(f, g)

def solve(alpha, beta, c):
	z = findGCD(alpha, beta)
	while len(str(z)) != c:
		beta += 1
		z = findGCD(alpha, beta)
	return (alpha, beta)
HCNList = [6, 60, 360, 5040, 55440, 720720, 4324320, 21621600, 367567200]
t = int(input())
for test in range(1, t + 1):
	(a, b, c) = [int(x) for x in input().split()]
	if c == min(a, b):
		print(str(10 ** (a - 1)), str(10 ** (b - 1)))
		continue
	if a < b:
		x = 10 ** (a - 1)
		y = HCNList[b - 1]
		(y, x) = solve(y, x, c)
	else:
		y = 10 ** (b - 1)
		x = HCNList[a - 1]
		(x, y) = solve(x, y, c)
	print(x, y)


import math
t = int(input())
for _ in range(0, t):
	(a, b, c) = list(map(int, input().split()))
	z = 3 ** math.ceil((c - 1) * math.log(10, 3))
	x = 7 ** math.ceil((a - 1) * math.log(10, 7) - math.log(z, 7)) * z
	y = 5 ** math.ceil((b - 1) * math.log(10, 5) - math.log(z, 5)) * z
	print(x, y)


for t in range(int(input())):
	(a, b, c) = map(int, input().split())
	print('1' + '0' * (a - 1), '1' * (b - c + 1) + '0' * (c - 1))


from collections import Counter
import math
import sys
import heapq
from bisect import bisect, bisect_left, bisect_right

def input():
	return sys.stdin.readline().strip()

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def mod():
	return 10 ** 9 + 7
for i in range(INT()):
	(a, b, c) = MAP()
	print(10 ** (a - 1), 10 ** (b - 1) + 10 ** (c - 1))


t = int(input())
for __ in range(t):
	(a, b, c) = map(int, input().split())
	aa = 10 ** (a - 1)
	ab = [1] * b
	ab = ab[:len(ab) - c + 1] + [0] * (c - 1)
	ans = 1
	for j in range(len(ab) - 1, -1, -1):
		if ab[j] == 1:
			ab[j] = ans
	print(aa, ' ', *ab, sep='')


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	print('1' + '0' * (a - c) + '0' * (c - 1), end=' ')
	print('1' * (b - c + 1) + '0' * (c - 1))


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	gc = '1' + '0' * (c - 1)
	A = {1: 3, 2: 11, 3: 101, 4: 1009, 5: 10007, 6: 100001, 7: 1000003, 8: 10000019, 9: 100000007}
	B = {1: 5, 2: 13, 3: 103, 4: 1013, 5: 10009, 6: 100019, 7: 1000033, 8: 10000169, 9: 100000049}
	a1 = A[a - c + 1] * int(gc)
	a2 = B[b - c + 1] * int(gc)
	print(a1, a2)


try:
	for _ in range(int(input())):
		(a, b, c) = map(int, input().split())
		x = 10 ** (max(a, b) - 1)
		y = 10 ** (c - 1)
		y = y * 9
		while 1 > 0:
			if len(str(y)) == min(a, b):
				break
			else:
				y = y * 9
		if a > b:
			print(x, y)
		else:
			print(y, x)
except:
	pass


for i in range(2000):
	i += 1
	continue
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	maxa = int('9' * a)
	maxb = int('9' * b)
	if a == 1 and b == 1 and (c == 1):
		print(1, 1)
	elif c == 1 and a == b:
		print(maxa, maxa - 1)
	elif c == 1 and a != b:
		if b != 1:
			maxb = int('9' * (b - 1)) + 1
		else:
			maxb = 1
		print(maxa, maxb)
	elif a == b and a == c:
		ans = int('9' * (a - 1)) + 1
		print(ans, ans)
	else:
		mc = int('9' * (c - 1)) + 1
		maxb -= maxb % mc
		maxa -= maxa % mc
		maxa -= mc
		print(maxa, maxb)


from math import ceil, gcd
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	g = 10 ** (c - 1)
	low = ceil(10 ** (b - 1) // g) * g
	high = ceil(10 ** (a - 1) // g) * g
	while gcd(low, high) != g:
		high += g
	print(high, low)


for _ in range(int(input())):
	(a, b, c) = map(int, input().split())

	def lenn(x):
		return len(str(x))
	(x, y) = (1, 1)
	while lenn(x) != c:
		x *= 2
		y *= 2
	while lenn(x) != a:
		x *= 5
	while lenn(y) != b:
		y *= 3
	print(x, y)


def fun(ls):
	ans1 = [0, 7, 49, 343, 2401, 16807, 117649, 5764801, 40353607, 282475249, 1977326743]
	ans2 = [1, 5, 25, 125, 3125, 15625, 390625, 1953125, 48828125, 244140625, 1220703125]
	(a, b, c) = ls
	if a == 1 and b == 1 and (c == 1):
		print(1, 1)
		return
	if c == 1:
		print(ans1[a], ans2[b])
		return
	elif a != b:
		a = a - 1
		show1 = 10 ** a
		show2 = ans1[b - c + 1] * 10 ** (c - 1)
		print(show1, show2)
	else:
		l1 = a
		ans = [0, 7, 49, 343, 2401, 16807, 117649, 5764801, 40353607, 282475249, 1977326743]
		if b - c != 0:
			a = a - 1
			show1 = 10 ** a
			show2 = ans[b - c + 1] * 10 ** (c - 1)
			print(show1, show2)
		else:
			a = a - 1
			mn = min(b, c)
			mn = mn - 1
			print(10 ** a, 10 ** mn)
T = int(input())
for i in range(T):
	ls = list(map(int, input().split()))
	fun(ls)


t = int(input())
while t > 0:
	(a, b, c) = map(int, input().split())
	mx = max(a, b)
	mn = min(a, b)
	z = mn
	s1 = '1'
	s2 = '1'
	c1 = mn - c
	mn = mn - c1 - 1
	for i in range(1, mx):
		s1 += '0'
	for i in range(0, c1):
		s2 += '1'
	for i in range(0, mn):
		s2 += '0'
	if len(s1) == a:
		print(int(s1), int(s2), end=' ')
	else:
		print(int(s2), int(s1), end=' ')
	print()
	t -= 1


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	(a, b, c) = map(int, stdin.readline().split())
	x = 10 ** (a - 1)
	y = 10 ** (b - 1) + 10 ** (c - 1)
	print(x, y)


primes = [0, 1, 11, 109, 1009, 10009, 100019, 1000003, 10000019, 100111001]
cases = int(input())
while cases:
	cases -= 1
	(a, b, c) = map(int, input().split())
	x = primes[c] * 10 ** (a - c)
	y = primes[c] * 10 ** (b - c) + primes[c]
	print(x, y)


from math import gcd
for _ in range(int(input())):
	(n, m, k) = map(int, input().split())
	fst = int('1' + '0' * (n - 1))
	scd = int('1' + '0' * (m - 1))
	kth = int('1' + '0' * (k - 1))
	h_kth = kth * 10
	p = 0
	t = 0
	s = 0
	for i in range(fst, fst * 10):
		if i % kth == 0:
			t = i
			break
	for i in range(scd, scd * 10):
		if i % kth == 0:
			s = i
			break
	if n > m:
		for i in range(t, fst * 10, kth):
			g = gcd(i, s)
			if g >= kth and g < h_kth:
				print(i, s)
				break
	else:
		for i in range(s, scd * 10, kth):
			g = gcd(i, t)
			if g >= kth and g < h_kth:
				print(t, i)
				break


from math import gcd
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	x = 10 ** (a - 1)
	y = 10 ** (b - 1)
	if a <= b:
		x += 10 ** (c - 1)
	else:
		y += 10 ** (c - 1)
	print(x, y)


import math
for t in range(int(input())):
	(a, b, c) = map(int, input().split())
	if c != 1:
		(x, y) = (10 ** (a - 1), 10 ** (c - 1) * (10 ** (b - c) + 1))
		print(x, y)
	else:
		(x, y) = (10 ** (a - 1), 10 ** (b - 1) + 1)
		print(x, y)


def countDigit(n):
	count = 0
	while n != 0:
		n //= 10
		count += 1
	return count
arr = [0, 2]
num = 2
tog = 2
while True:
	if countDigit(num) == tog:
		arr.append(num)
		tog += 1
	num *= 2
	if tog > 9:
		break
t = int(input())
for test in range(t):
	(a, b, c) = map(int, input().split())
	num1 = arr[a]
	num2 = arr[c]
	while True:
		if countDigit(num2) == b:
			break
		num2 = num2 * 3
	print(num1, num2)


t = int(input())
while t > 0:
	t -= 1
	(a, b, c) = map(int, input().split())
	x = 10 ** (a - 1)
	y = 10 ** (b - 1) + 10 ** (c - 1)
	print(x, y)


t = int(input())
l = [[2, 3], [11, 13], [101, 103], [1009, 1013], [10007, 10009], [100003, 100019], [1000003, 1000033], [10000019, 10000169], [100030001, 100050001]]
for _ in range(t):
	(a, b, c) = map(int, input().split())
	print(10 ** (c - 1) * l[a - c][0], 10 ** (c - 1) * l[b - c][1])


from math import log
for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	c = 10 ** (c - 1)
	ta = 10 ** a - 1
	ta = ta - ta % c
	ta //= c
	x = int(log(ta, 3))
	x = 3 ** x * c
	tb = 10 ** b - 1
	tb = tb - tb % c
	tb //= c
	y = int(log(tb, 2))
	y = 2 ** y * c
	print(x, y)


import time
import os, sys
from io import BytesIO, IOBase
from types import GeneratorType
from bisect import bisect_left, bisect_right
from collections import defaultdict as dd, deque as dq, Counter as dc
import math, string, heapq as h
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def getInt():
	return int(input())

def getStrs():
	return input().split()

def getInts():
	return list(map(int, input().split()))

def getStr():
	return input()

def listStr():
	return list(input())

def getMat(n):
	return [getInts() for _ in range(n)]

def getBin():
	return list(map(int, list(input())))

def isInt(s):
	return '0' <= s[0] <= '9'

def ceil_(a, b):
	return a // b + (a % b > 0)
MOD = 10 ** 9 + 7

def solve():
	(A, B, C) = getInts()
	Z = 10 ** (C - 1)
	X = Z
	Y = Z
	while not len(str(X)) == A:
		X *= 7
	while not len(str(Y)) == B:
		Y *= 3
	print(X, Y)
	return
for _ in range(getInt()):
	solve()


from sys import stdin
from math import gcd
input = stdin.readline
tcs = int(input())
for tc in range(tcs):
	(a, b, c) = list(map(int, input().split()))
	nc = int('1' + '0' * (c - 1))
	print(nc * int('1' + '0' * (a - c)) + nc, nc * int('1' + '0' * (b - c)))


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import Counter, defaultdict
import math
mod = 1000000007
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	v1 = 10 ** (a - 1)
	v2 = 10 ** (b - 1)
	le = min(a, b)
	f = 0
	if v1 > v2:
		(v1, v2) = (v2, v1)
		f = 1
	v1 = list(str(v1))
	for i in range(1, len(v1)):
		if le <= c:
			break
		v1[i] = '1'
		le -= 1
	v1 = ''.join(v1)
	if c == 1:
		print('1' * a, 1 * 10 ** (b - 1))
		v1 = '1' * a
	elif f == 1:
		print(v2, v1)
	else:
		print(v1, v2)


for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	c1 = 10 ** (c - 1) + 1
	if c == 1:
		print(10 ** (a - 1), 10 ** (b - 1) + 1)
	else:
		x = len(str(c1))
		x1 = c1 * 10 ** (a - x) + c1
		x2 = c1 * 10 ** (b - x) + c1 + c1
		print(x1, x2)


def _int():
	return int(input())

def _mult():
	return map(int, input().split())

def _list():
	return list(map(int, input().split()))

def solve():
	prime = getZ()
	for _ in range(_int()):
		(x, y, c) = _mult()
		Z = prime[c]
		A = Z
		B = Z
		while count(A) != x:
			A *= 2
		while count(B) != y:
			B *= 3
		print(A, B)

def getZ():
	prime = [0, 1, 11, 101, 1009, 10007, 100003, 1000007, 10000009, 100000009]
	return prime

def count(n):
	ans = 0
	while n:
		ans += 1
		n = n // 10
	return ans
solve()


t = int(input())
while t > 0:
	(a, b, c) = map(int, input().split())
	x = 1
	y = 1
	while len(str(x)) != c:
		if len(str(x)) == c:
			break
		x *= 2
		y *= 2
	while len(str(x)) != a:
		if len(str(x)) == a:
			break
		x *= 3
	while len(str(y)) != b:
		if len(str(y)) == b:
			break
		y *= 5
	print(x, y)
	t -= 1


from sys import maxsize, stdout, stdin, stderr
mod = int(1000000000.0 + 7)

def I():
	return int(stdin.readline())

def lint():
	return [int(x) for x in stdin.readline().split()]

def S():
	return input().strip()

def grid(r, c):
	return [lint() for i in range(r)]
from collections import defaultdict
import math
l = [2, 16, 128, 1024, 16384, 131072, 1048576, 16777216, 134217728]
t = I()
for _ in range(t):
	(a, b, c) = lint()
	c -= 1
	c = l[c]
	a1 = l[a - 1]
	b -= 1
	b1 = c
	while b1 / 10 ** b < 1:
		b1 *= 3
	print(a1, b1)


import sys
ints = (int(x) for x in sys.stdin.read().split())
sys.setrecursionlimit(3000)

def main():
	ntc = next(ints)
	for tc in range(1, ntc + 1):
		(a, b, c) = (next(ints) for i in range(3))
		gcd = 10 ** (c - 1)
		x = gcd * next((2 ** k for k in range(90) if len(str(2 ** k)) == a - c + 1))
		y = gcd * next((3 ** k for k in range(90) if len(str(3 ** k)) == b - c + 1))
		print(x, y)
	return
main()


t = int(input())
for i in range(t):
	(a, b, c) = tuple(map(int, input().split()))
	x = 10 ** (a - 1)
	y = 10 ** (b - 1)
	gcd = 10 ** (c - 1)
	print(x, y + gcd)


T = int(input())
for t in range(T):
	(a, b, c) = [int(i) for i in input().split()]
	gcd = 10 ** (c - 1)
	x = gcd
	lim = 10 ** (a - 1)
	while x < lim or x < gcd:
		x *= 2
	y = gcd
	lim = 10 ** (b - 1)
	while y < lim or y < gcd:
		y *= 3
	print(x, y)


for s in [*open(0)][1:]:
	(a, b, c) = (10 ** (int(x) - 1) for x in s.split())
	print(a, b + c)


def solve():
	(a, b, c) = map(int, input().split())
	print('1' + '0' * (a - 1), end=' ')
	if b == c:
		print('1' + '0' * (b - 1))
	else:
		print('1' + '0' * (b - c - 1) + '1' + '0' * (c - 1))
t = int(input())
for i in range(t):
	solve()