# written by ChatGPT o4-mini-high (really sorry) import sys def main(): # Pre‐chosen magic constants: A = 5760 B = 30030 # 1) send A, B print(A, B, flush=True) # 2) read K = gcd(X, A^B mod 1e9+7) line = sys.stdin.readline().strip() if not line: return K = int(line) # 3) predict X' = X^A mod B: # we know X' = 1 if gcd(X,B)==1, else 0, # and gcd(X,B)==K since all prime factors of B divide Y. if K == 1: Xp = 1 else: Xp = 0 # 4) output our guess print(Xp, flush=True) # 5) read judge verdict (not really used) _ = sys.stdin.readline() if __name__ == "__main__": main()