n = int(input()) if n % 2 == 0: print(2, n // 2) else: print(1, n // 2 + 1) while True: t = int(input()) if t != 3: break k, x = map(int, input().split()) print(k, n + k - x + 2)