puts"Gray code n=#{n=gets.to_i}";(2**n).times{|i|puts"%0#{n}b"%(i^i/2)}