// Murabito-B 21/04/13
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve() {
    int a, b, c;
    cin >> a >> b >> c;
    for (int i = 0; i <= a - c; ++i) cout << 1;
    for (int i = 1; i < c; ++i) cout << 0;
    cout << " 1";
    for (int i = 1; i < b; ++i) cout << 0;
    cout << "\n";
}
int main() {
    ios_base::sync_with_stdio(false), cin.tie(0);
    int _;
    for (cin >> _; _--;) solve();
    return 0;
}