#include<bits/stdc++.h>
 
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define ROF(i,a,b) for(int i=(a);i>=(b);i--)
 
 
using namespace std;
 
 
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ull> vull;
typedef vector<char> vc;
typedef vector<bool> vb;
 
const int N = 1e6 + 10;

 
void process () {
	ll a,b,c;
	cin>>a>>b>>c;
    ll x1=1;
    a--;
    while(a--)
    {
    	x1=10*x1;
    }
    ll y1 = 1;
    b--;
    while(b--)
    {
    	y1=10*y1;
    }
    ll c1 =1;
    c--;
    while(c--)
    {
    	c1=10*c1;
    }
  
    if(x1==y1)
    {
    	x1+=c1;
    	y1+=2*c1;
    }
    else
    {
    	if(x1<y1)
    	{
    		x1+=c1;
    	}
    	else
    	{
    		y1+=c1;
    	}
    }
  
    cout<<x1<<" "<<y1<<endl;

}
 
int main () {
    int t;
    cin >> t;
    while (t--) {
                process ();
    }
    return 0;
}//corner case 9 3 2