#include <bits/stdc++.h>

#define ed end()
#define bg begin()
#define mp make_pair
#define pb push_back
#define all(x) x.bg,x.ed
#define newline puts("")
#define si(x) ((int)x.size())
#define rep(i,n) for(int i=1;i<=n;++i)
#define rrep(i,n) for(int i=0;i<n;++i)
#define srep(i,s,t) for(int i=s;i<=t;++i)
#define drep(i,s,t) for(int i=t;i>=s;--i)

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int Maxn = 1e5+10;
const int Inf = 0x7f7f7f7f;
const ll Inf_ll = 1ll*Inf*Inf;
const int Mod = 1e9+7;
const double eps = 1e-7;

int a[11], b[11], c[11];

int dig(int x){
    int cnt = 0;
    while( x )  cnt++, x /= 10;
    return cnt;
}

void init(){
    int tmp = 1;
    while( 233 )
    {
        int cnt = dig(tmp);
        a[cnt] = tmp;
        if( cnt >= 9 )  break;
        tmp *= 2;
    }
    tmp = 1;
    while( 233 )
    {
        int cnt = dig(tmp);
        b[cnt] = tmp;
        if( cnt >= 9 )  break;
        tmp *= 3;
    }
    tmp = 1;
    while( 233 )
    {
        int cnt = dig(tmp);
        c[cnt] = tmp;
        if( cnt >= 9 )  break;
        tmp *= 10;
    }
}

void solve(){
    int aa, bb, cc;
    scanf("%d %d %d",&aa,&bb,&cc);
    printf("%d %d\n", a[aa-cc+1]*c[cc], b[bb-cc+1]*c[cc]);
}

int main(){
    init();
    int T;
    scanf("%d",&T);
    for(int _=1;_<=T;_++)
    {
        solve();
    }
    return 0;
}