# import pypyjit # pypyjit.set_param('max_unroll_recursion=-1') from collections import * from itertools import * from functools import * from heapq import * import sys,math input = sys.stdin.readline N = int(input()) A = list(map(int,input().split())) Q = int(input()) X = list(map(int,input().split())) S = sum(A) h = [-a for a in A] heapify(h) for i in range(Q): x = X[i] while True: y = heappop(h) y *= -1 if y