#include <bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define int long long
#define ld long double
#define fi first
#define se second
#define all(uiet) uiet.begin(),uiet.end()
#define read(UIET, n) for(int i = 0; i < n; ++i) cin >> UIET[i]
#define out(UIET, n) for(int i = 0; i < n; ++i) cout << UIET[i] << " "
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define vpp vector<pair< int, int > >
#define pll pair<int , int >
#define ppll pair < pll , pll >
#define debug(n1) cout << n1 << endl
#define len(a) ((int) (a).size())
#define endl "\n"
#define mod 1000000007
const int INF = (1LL<<60)-1;
const int maxN = 1000001;
int32_t main(){
    SPEED;
    int t = 1;
    cin >> t;
    while(t--){
        int a, b, c;
        cin >> a >> b >> c;
        string s1(a, '0');
        string s2(b, '0');
        string s3(c, '0');
        s1[0] = '1', s2[0] = '1', s3[0] = '1';
        int n1 = stoi(s1);
        int n2 = stoi(s2);
        int n3 = stoi(s3);
        n2 += n3;
        cout << n1 << " " << n2 << endl;
    }
} 
/* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* WRITE STUFF DOWN
	* DON'T GET STUCK ON ONE APPROACH
*/