import heapq right=[] left=[] heapq.heapify(right) heapq.heapify(left) root=int(input()) for i in range(1,10000001): if i%2==1: a=int(input()) else: b=int(input()) if root