There are players in a football team, numbered with integers from to . The skill level of player with number is described by the integer c_i.
The players are arranged in a circle in such a way that the player with number has the player with number i+1 on their right side (for 1 \le i < n), and for the player with number , the next player is the one with number .
Let's define the strength of a game combination, characterized by an array of integers k=[k_0, k_1, k_2, \ldots, k_{m-1}], as follows:
initially, the ball is with the player with number ;
the players pass the ball in turns indefinitely: when performing the pass with number , the player who currently has control of the ball passes it to the player located positions to the right in the circle, where x=k_{((i-1) \mod m)};
the strength of the game combination is considered to be the minimum skill level among the skills of all players who had the ball at some point during the described process.
An array of integers a_0,a_1,\ldots,a_{q-1} is given. For each from to (q-1), find the strength of the game combination characterized by the array [a_0,a_1,\ldots,a_i].
The first line contains two integers and (1 \leq n, q \leq 3\cdot{10}^5) — the number of players and the length of the array .
The second line contains integers c_1, c_2, \dots, c_n (1 \leq c_i \leq n) — the skill levels of the players.
The third line contains integers a_0, a_1, \dots, a_{q-1} (1 \leq a_i \leq n-1) — the elements of the array .
Output integers — the sought values of the strengths of game combinations.
Example 1
In the example of passing the ball for game combinations, it looks as follows:

k=[3]

k=[3,1]

k=[3,1,2]
( points): n, q \leq 100;
( points): all values of a_i are the same;
( points): is a prime number;
( points): n, q \leq 1000;
( points): n, q \leq 1.5\cdot{10}^5, n = 2^k for some integer ;
( points): n, q \leq {10}^5;
( points): without additional constraints.