n=int(input()) q=[list(map(int,input().split())) for _ in range(1<