#include<iostream>
#include<string>
using ll=long long;
#include <utility>
using namespace std;
#include<sstream>
ll mod=1e9+7;
#include<bits/stdc++.h>
#define ya  cout<<"YES"<<endl;
#define no  cout<<"NO"<<endl;
#define pb push_back
#define fast_cin ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(bi) bi.begin(),bi.end()
int main()
{
    fast_cin;
    ll n,i,j,x,t,m,a,b,c,chk,sum1,sum,sum2;
    vector<ll>bi;
    map<ll,ll>mp;
    cin>>t;
    while(t--)
    {
        cin>>a>>b>>c;
         sum=sum1=sum2=1;
        for(i=1; i<=a-1; i++)
        {
            sum=sum*10;
        }
        for(i=1; i<=b-1; i++)
        {
            sum1=sum1*10;
        }
        for(i=1; i<=c-1; i++)
        {
            sum2=sum2*10;
        }
        sum=sum/sum2;
        sum1=sum1/sum2;
        sum1++;
        cout<<sum*sum2<<" "<<sum1*sum2<<endl;
        //cout<<"this "<<__gcd(sum*sum2,sum1*sum2)<<endl;

    }
}
