#!/usr/bin/ python3.8 import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines from heapq import heapify, heapreplace N = int(readline()) q = [(-int(x), 1) for x in readline().split()] Q = int(readline()) K = tuple(map(int, readline().split())) U = 5 * 10**5 answer = [0] * (U + 1) heapify(q) for i in range(1, U + 1): x, j = q[0] answer[i] = -x x *= j j += 1 x /= j heapreplace(q, (x, j)) print('\n'.join(str(answer[k]) for k in K))