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

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';} 
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

#define sz(x) (int)(x).size()
#define all(x) x.begin(), x.end()
typedef long long ll;

int decimal(int a){
    int cnt =0;
    while (a){
        cnt++;
        a/=10;
    }
    return cnt;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int t; cin>>t;

    while (t--){
        int a, b, c;
        cin>>a>>b>>c;

        int g = 1;
        for (int i=0;i<c-1;++i) g*=10;

        int n=1;
        for (int i=0;i<a-c;++i){
            n *= 10;
        }
        int m = 1;
        for (int i=0;i<b-c;++i){
            m *= 11;
        }
        cout<<n*g<<" "<<m*g<<"\n";
    }

    /* while (t--){
        int a, b, c;
        cin>>a>>b>>c;

        int startb=1, endb;
        int starta=1, enda;

        for (int i=0;i<b-1;++i)
            startb*=10;
        for (int i=0;i<a-1;++i)
            starta*=10;
        endb = startb*10;
        enda = starta*10;
        
        bool found = false;
        for (int i=starta; i<enda && !found;++i){
            for (int j=startb; j<endb & !found;++j){
                int g = __gcd(i, j);
                if (decimal(g) == c){
                    cout<<i<<" "<<j<<"\n";
                    found = true;
                    break;
                }
            }
        }
    } */

    return 0;
}

/* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* WRITE STUFF DOWN
	* DON'T GET STUCK ON ONE APPROACH
*/