#include <bits/stdc++.h>
using namespace std;
# define F first
# define S second
vector<vector<int>> adj;

int main()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(false);
    int i,t;
    cin >>t;
    //t=1;
    while(t--)
    {
        int a,b,c;
        cin >> a >>b >>c;
        long long int mul = 0;
        for(i=0;i<c;i++)
            mul = (long long int)2*pow(10,i) + mul; 
        cout << (long long int)pow(10,a-c)*mul <<" " << (long long int)(pow(10,b-c)+1)*mul <<"\n";
    }
}