x=1 M=int(input()) for _ in range(128): x=(2*x)%M print(x)