#include<bits/stdc++.h>
using namespace std;
using ll = long long;

#define F first
#define S second

ll count_digits(ll x){
    ll count = 0;
    while(x > 0){
        count++;
        x /= 10;
    }
    return count;
}

int main(){
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    ll tc; cin >> tc;
    while(tc--){
        ll a, b, c; cin >> a >> b >> c;
        ll x = 1, y = 1;
        while(count_digits(x) < c){
            x *= 2;
            y *= 2;
        }
        while(count_digits(x) < a){
            x *= 3;
        }
        while(count_digits(y) < b){
            y *= 5;
        }
        cout << x << ' ' << y << '\n';

    }
    return 0;
}