#include <bits/stdc++.h>
#define fi first
#define se second
#define max3(a, b, c) max(a, max(b, c))
#define writef(a, n) cout << fixed << setprecision(n) << a

using namespace std;

typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> ii;
typedef pair<ll, ii> iii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;

int main()
{
    ios::sync_with_stdio(0); cin.tie(0);
    ///freopen("t.inp", "r", stdin);
    ll t, a, b, c, x, y, z;
    cin >> t;
    while (t--) {
        cin >> a >> b >> c;
        x = 1;
        z = 1;
        while (log10(z)+1 < c) {
            z *= 2;
        }
        while (log10(z)+1 < b) {
            z *= 3;
        }
        while (log10(x)+1 < a) {
            x *= 2;
        }
        cout << x << " " << z << "\n";
    }
    return 0;
}
