There are $2n$ cards with numbers from $1$ to $2n$ written on them, stacked in the order $1, 2, 3, \ldots, 2n$ from the top.
These cards are rearranged by applying the following methods several times:
Cut with integer $k$
Divide the deck into pile A of the top $k$ cards and pile B of the remaining $2n-k$ cards, and then place pile B on top of pile A.
Riffle shuffle
Divide the deck into pile A of the top $n$ cards and pile B of the remaining $n$ cards, and combine them into $1$ pile so that from the top the cards are: the $1$st card of A, the $1$st card of B, the $2$nd card of A, the $2$nd card of B, $\ldots$, the $n$-th card of A, the $n$-th card of B.
Write a program that rearranges the cards according to the instructions in the input and outputs the numbers on the cards after rearrangement in order from the top.
Input
- Line $1$ contains $n$ ($1 \le n \le 100$). That is, the number of cards is $2n$.
- Line $2$ contains the number of operations $m$ ($1 \le m \le 1000$).
- The $m$ lines from line $3$ to line $m + 2$ each contain $1$ integer $k$ between $0$ and $2n-1$, specifying the methods to rearrange the cards in order:
- If $k = 0$, perform a riffle shuffle.
- If $1 \le k \le 2n-1$, perform a cut with $k$.
Output
The output consists of $2n$ lines. On line $1$, output the number of the top card after rearrangement; on line $2$, output the number of the $2$nd card from the top after rearrangement; and so on, outputting the number of the $i$-th card from the top on line $i$.
Examples
Input 1
2 2 1 0
Output 1
2 4 3 1
Input 2
3 4 2 4 0 0
Output 2
1 5 4 3 2 6