N = int(input()) if N%2==1: print(1,(N+1)//2) else: print(2,N//2) s = int(input()) while s==3: a, b = map(int, input().split()) print(a,N+1-b-(a-1)) s = int(input())