#t261. 军事机密

军事机密

Military Secret

Problem Background

Special for beginners, ^_^

Problem Description

The intercepted message consists of nn (n≤30000n \le 30000) numbers. Because it is a top-secret of an enemy country, it cannot be deciphered right away. The most naive idea is to sort these nn numbers in ascending order; each number then corresponds to an index. We are interested in what the ii-th number is, and we ask you to write a program to answer this.

Input Format

The first line contains nn. Then follow nn intercepted numbers. Then a line with the number kk. Then kk lines, each containing an index of a number to be output.

Output Format

kk lines: the numbers at the requested indices (in the order given by the queries).

Sample Input

5
121 1 126 123 7
3
2
4
3

Sample Output

7
123
121

Constraints

Time limit: 1s, memory limit: 1024KiB for each test case.

Hint

The indices are 1-based: after sorting the numbers in ascending order, the index 11 refers to the smallest number.