a=input() print"Gray code n="+`a` for i in range(2**a): s='';y=a+1 while y-1:u=2**y;y-=1;s+=`1*(u/4<=i%u<3*u/4)` print s