#include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
int l,y;
int gs=0;
for(int i=1; i<=n; i++) {
cin>>l>>y;
for(int j=1; j<=l; j++) {
cout<<0;
gs++;
if(gs==n) {
cout<<endl;
gs=0;
}
}
for(int j=1; j<=y; j++) {
cout<<1;
gs++;
if(gs==n) {
cout<<endl;
gs=0;
}
}
}
return 0;
}