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