The Legendary Huron is learning about sorting algorithms. After studying Bubble Sort and Bogo Sort, he became so enthusiastic that he invented his own algorithm: the Legendary Sort. This algorithm sorts an array and consists of two phases:
The Legendary Huron wants to test his new algorithm in different scenarios. For that, he considers a permutation $$$[p_1,p_2,\dots,p_n]$$$ of length $$$n$$$, and processes $$$q$$$ queries on this permutation. Each query is one of the following types:
Help the Legendary Huron to process these queries.
The first line contains two integers $$$n$$$ and $$$q$$$ ($$$2 \leq n \leq 2 \cdot 10^5$$$ and $$$1 \leq q \leq 2 \cdot 10^5$$$) — the length of the permutation and the number of queries.
The second line contains $$$n$$$ distinct integers $$$p_1,p_2,\dots,p_n$$$ ($$$1 \leq p_i \leq n$$$) — the permutation.
Each of the next $$$q$$$ lines describes a query. Each line begins with an integer $$$t$$$ ($$$t \in \{1,2\}$$$) — the type of the query. If $$$t=1$$$, an integer $$$i$$$ ($$$1 \leq i \lt n$$$) follows. If $$$t=2$$$, an integer $$$k$$$ ($$$0 \leq k \lt n$$$) follows.
For each query of type $$$t=2$$$, print an integer — the minimum number of times that the swap operation can be performed in the second phase.
5 51 2 3 4 52 02 21 22 02 2
0 6 1 5
5 23 4 5 1 22 32 0
0 6