Ikaros has given you a sequence $a$ of length $n$.
You need to perform $m$ operations of two types:
- Change all values in the sequence equal to $x$ to $y$.
- Find a position $i$ such that $a_i=x$ and a position $j$ such that $a_j=y$ that minimize $|i-j|$, and output $|i-j|$.
Input
The first line contains two integers $n$ and $m$.
The next line contains $n$ integers, representing the sequence $a$.
The following $m$ lines each contain three integers $opt, x, y$.
If $opt$ is $1$, it means to change all values in the sequence equal to $x$ to $y$.
If $opt$ is $2$, it means to find a position $i$ such that $a_i=x$ and a position $j$ such that $a_j=y$ that minimize $|i-j|$, and output $|i-j|$. If no such positions can be found, output Ikaros.
This problem is forced online. Each $x$ and $y$ must be XORed with the answer to the previous query. If the output was Ikaros or if it is the first query, the previous answer is $0$.
There are $50$ test cases in total, and it is guaranteed that $n=m$.
Output
For each operation of type $2$, output a single integer representing the answer on a new line.
If it is impossible to find $i$ and $j$ satisfying the conditions, output Ikaros.
Examples
Input 1
5 5
1 2 2 4 4
2 3 3
2 2 4
1 3 2
1 5 5
2 2 5
Output 1
Ikaros
1
1
Subtasks
Idea: nzhtl1477, Solution: nzhtl1477, Code: nzhtl1477, Data: nzhtl1477 (partially uploaded)
For $100\%$ of the data, all values are in the range $[1, 10^5]$, and the values in each operation do not exceed $n$.