import sys,heapq input=lambda:sys.stdin.readline().rstrip() N=int(input()) L=list(map(int,input().split())) Q=int(input()) K=list(map(int,input().split())) check=[] M=max(K) h=[] for i in range(N): heapq.heappush(h,[-L[i],1]) while len(check)