#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define lop(n) for(ll i=0;i<n;i++)
#define loop(a,b) for(ll i=a;i<b;i++)
#define MOD 1000000007
#define en "\n"
#define F first
#define S second
#define inputlist for(ll i=0;i<n;i++) cin>>A[i]
#define pb(x) push_back(x)
#define MP make_pair
#define PI 3.14159265

void solve()
{
    ll a,b,c;
    cin>>a>>b>>c;
    ll x=pow(10,a-1);
    ll y=pow(10,b-1)+pow(10,c-1);
    cout<<x<<" "<<y<<en;

}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    ll t=1;

    cin>>t;
    for(ll i=1;i<=t;i++)
    {
        solve();
    }
    return 0;
}