#include <bits/stdc++.h>
#include<cmath>
#include<algorithm>
#include<string.h>
using namespace std;
 int main()
{
    long long int t,a,b,c;
    cin>>t;
    while(t--)
    { long long int l=0,m=0,n=0;
        cin>>a>>b>>c;
        l=pow(10,a-1); m=pow(10,b-1); n=pow(10,c-1);
     if(a>b)
     {
         cout<<l<<" "<<m+n<<endl;
     }
     else{cout<<l+n<<" "<<m<<endl;}}

    return 0;
}
