n=input() i=0 print"Gray code n="+`n` while i<2**n:s="";g=i^i/2;exec"s=`g&1`+s;g/=2;"*n;print s;i+=1