m = int(input()) b = 2 for i in range(7): b = b * b % m print(b)