#t261. 军事机密
军事机密
Military Secret
Problem Background
Special for beginners, ^_^
Problem Description
The intercepted message consists of () 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 numbers in ascending order; each number then corresponds to an index. We are interested in what the -th number is, and we ask you to write a program to answer this.
Input Format
The first line contains . Then follow intercepted numbers. Then a line with the number . Then lines, each containing an index of a number to be output.
Output Format
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 refers to the smallest number.