You will get several big numbers.
You have to sort these numbers in decreasing order.
Input
The first line is an integer N (1≤N≤10000) means the number of big numbers.
In the following lines, each line is a big number with K digits (1≤K≤50).
Then the line after the big numbers is an integer M (5≤M≤10) means the number of queries.
In the following lines, each line is an integer Q (1≤Q≤N) means you need to print out the Q-th big number.
Output
There must have M lines.
Each line is a big number according to each query Q.
Sample Input
5
362563562
936215450250525
156164546213651615
936215450228602
125345963
5
1
2
3
4
5
Sample Output
156164546213651615
936215450250525
936215450228602
362563562
125345963
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments