#include<bits/stdc++.h>
using namespace std;
using lol=long long int;
#define endl "\n"
const lol mod1=1e9+7;

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;
    string sa(a,'0'),sb(b,'0');
    sa[0]='1',sb[0]='1';
    if(c<min(a,b))  sb[b-c]='1';
    cout<<sa<<endl;
    cout<<sb<<endl;
}
return 0;
}
