It's not Time for Games
There are people standing in a circle, where person and person are neighbors for every , and person and person are neighbors. Each person has a skill level represented by an integer . Neighbors form a pair with a skill level of . Unfortunately, they are all busy people, so the -th person leaves the circle at time . When person leaves, the indices do not shift. That is, if there were pairs and , then the pair will not be formed after the departure of person .
You are given queries, each containing one integer . For each query, output an integer — the maximum skill level that can be formed with people who are still present at time .
Input
The first line contains two integers () and () — the initial number of people in the circle and the number of queries.
The second line contains integers () — the skill level values of the -th person.
The following lines contain one integer ().
Output
Print lines, the -th of which contains the answer to the -th query.
Examples
Note
The explanation for the first example:
The first query has . Let be those who left the circle, so we have . There is one pair from the second and third elements — .
The second query has . Nobody has left the circle yet, so we have . There are three pairs — the first with the second, the second with the third, and the third with the first. Their skill levels are , , and , respectively.