var i,j,n:word;begin read(n);write('Gray code n=',n);for i:=0to 1shl n-1do for j:=0to n-1do write(^j:1shr j,(i*2xor i)shr(n-j)and 1)end.