There are multiple test cases, about $10$ cases.
The first line of input contains two integers $n,m(1 \leq n,m \leq 20000)$.
The second line contains $n$ integers $H_1,H_2,...,H_n(1 \leq H_i \leq n)$,indicate the height of each kids in the initial queue from left to right.
For the next $m$ lines ,each line means a kid leave or join.
$0$ $x$ $y$ means a kid of $y$ height stands behind the $xth$ kid,$x=0$ means stand at the front of the queue.$(1 \leq y \leq n)$
$1$ $x$ indicate the $xth$ (from left to right) kid leave.