#include <bits/stdc++.h>
#define ll long long
using namespace std;


ll ln(ll n)
{
    ll cnt=0;
    while(n>0)
    {
        n/=10;
        cnt++;
    }
    return cnt;
}

int main()
{
    ll TC;
    cin>>TC;
    while(TC--)
    {
       ll a,b,c;
        cin>>a>>b>>c;
        ll x=1,y=1;
        ll j=1;
        while(ln(j)<c)
        {
            x*=2;
            y*=2;
            j*=2;
        }
        while(ln(y)<b)
        {
            y*=2;
        }
        while(ln(x)<a)
        {
            x*=3;
        }
        cout<<x<<" "<<y<<"\n";
    }
    return 0;
}
