Big sorting#11638

Big sorting

1 second
128 megabytes
Easy

Given an array a_1, a_2, ..., a_n of integers. Sort it in ascending order.

Then answer queries: for each input value print a_k.

Input

The first line contains the size n~(n \le 10^6) of array and the number of queries q~(q \le 10^5).

The second line contains the array elements a_1, a_2, ..., a_n.

Each of the following lines contains a query: one integer k~(1 \le k \le n).

Output

For each query print a_k on a separate line: the -th number in the sorted array.

Examples

Sort the numbers in the given sample:

The answers to the queries are: a_4 = 5, a_5 = 6, a_1 = 1, a_7 = 7, a_2 = 1.

Example 1

Loading
Loading