#include<bits/stdc++.h>
using namespace std;
long long n,x,y,t;
int main()
{
cin>>n;
while(t!=n*n)
{
cin>>x>>y;
for(int j=1;j<=x;j++)
{
t++;
cout<<"0";
if(t%n==0)
cout<<"\n";
}
for(int j=1;j<=y;j++)
{
t++;
cout<<"1";
if(t%n==0)
cout<<"\n";
}
}
return 0;
}