#include<bits/stdc++.h>
using namespace std;
void solve()
{
	int x=1, y=1, z=1;
	int a, b, c;
	cin >> a >> b >> c;
	for (int i = 1; i < a; i++)
		x *= 10;
	for (int i = 1; i < b; i++)
		y *= 10;
	for (int i = 1; i < c; i++)
		z *= 10;
	if (a > c && b > c)
		x += z;
	cout << x <<" "<< y<<"\n";
	return;
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int t;
	cin >> t;
	while (t--)
	{
		solve();
	}
	return 0;
}