import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(2*10**5+10) write = lambda x: sys.stdout.write(x+"\n") debug = lambda x: sys.stderr.write(x+"\n") writef = lambda x: print("{:.12f}".format(x)) n = int(input()) l = list(map(int, input().split())) q = int(input()) k = list(map(int, input().split())) from heapq import heappop as hpp, heappush as hp, heapify h = [] for i in range(n): h.append((-l[i], 1)) heapify(h) index = list(range(q)) ans = [-1]*q index.sort(key=lambda i: k[i]) v = 0 for j in range(q): to = k[index[j]] while v