{"raw_statement":[{"iden":"problem statement","content":"There are $N$ squares, indexed Square $1$, Square $2$, …, Square $N$, arranged in a row from left to right.  \nAlso, there are $K$ pieces. The $i$\\-th piece from the left is initially placed on Square $A_i$.  \nNow, we will perform $Q$ operations against them. The $i$\\-th operation is as follows:\n\n*   If the $L_i$\\-th piece from the left is on its rightmost square, do nothing.\n*   Otherwise, move the $L_i$\\-th piece from the left one square right if there is no piece on the next square on the right; if there is, do nothing.\n\nPrint the index of the square on which the $i$\\-th piece from the left is after the $Q$ operations have ended, for each $i=1,2,\\ldots,K$."},{"iden":"constraints","content":"*   $1\\leq K\\leq N\\leq 200$\n*   $1\\leq A_1<A_2<\\cdots<A_K\\leq N$\n*   $1\\leq Q\\leq 1000$\n*   $1\\leq L_i\\leq K$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $K$ $Q$\n$A_1$ $A_2$ $\\ldots$ $A_K$\n$L_1$ $L_2$ $\\ldots$ $L_Q$"},{"iden":"sample input 1","content":"5 3 5\n1 3 4\n3 3 1 1 2"},{"iden":"sample output 1","content":"2 4 5\n\nAt first, the pieces are on Squares $1$, $3$, and $4$. The operations are performed against them as follows:\n\n*   The $3$\\-rd piece from the left is on Square $4$. This is not the rightmost square, and the next square on the right does not contain a piece, so move the $3$\\-rd piece from the left to Square $5$. Now, the pieces are on Squares $1$, $3$, and $5$.\n*   The $3$\\-rd piece from the left is on Square $5$. This is the rightmost square, so do nothing. The pieces are still on Squares $1$, $3$, and $5$.\n*   The $1$\\-st piece from the left is on Square $1$. This is not the rightmost square, and the next square on the right does not contain a piece, so move the $1$\\-st piece from the left to Square $2$. Now, the pieces are on Squares $2$, $3$, and $5$.\n*   The $1$\\-st piece from the left is on Square $2$. This is not the rightmost square, but the next square on the right (Square $3$) contains a piece, so do nothing. The pieces are still on Squares $2$, $3$, and $5$.\n*   The $2$\\-nd piece from the left is on Square $3$. This is not the rightmost square, and the next square on the right does not contain a piece, so move the $2$\\-nd piece from the left to Square $4$; Now, the pieces are still on Squares $2$, $4$, and $5$.\n\nThus, after the $Q$ operations have ended, the pieces are on Squares $2$, $4$, and $5$, so $2$, $4$, and $5$ should be printed in this order, with spaces in between."},{"iden":"sample input 2","content":"2 2 2\n1 2\n1 2"},{"iden":"sample output 2","content":"1 2"},{"iden":"sample input 3","content":"10 6 9\n1 3 5 7 8 9\n1 2 3 4 5 6 5 6 2"},{"iden":"sample output 3","content":"2 5 6 7 9 10"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}