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

int main() {
    int t;
    cin>>t;
    while (t--){
        int a,b,c;
        cin>>a>>b>>c;
        int z= pow(10,c-1);
        int x= pow(10,a-1);
        int y= pow(10,b-1)+z;
        cout<<x<<" "<<y<<endl;
    }
	// your code goes here
	return 0;
}
