n=input('Gray code n=') print n for i in range(1<>1)[2:].zfill(n)