n=System.in.read()%8 o='Gray code n='+n 0.upto(m=2**n){println o;o=0.toString(m|it^it>>1,2)-1}