#include<bits/stdc++.h>
using namespace std;
using ll=long long;
const int mod=1e9+7;

void solve(){
    int a,b,c; cin>>a>>b>>c;
    ll A=pow(10,a-1);
    ll B=pow(10,b-1)+pow(10,c-1);
    ll C=pow(10,c-1);
    cout<<A<<" "<<B<<endl;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    int t; cin>>t;
    while(t--) solve();
}