Due to unforeseen circumstances this task is not fifth.
A recent survey by polling agency "Ko & co" found that no one likes the numbers from $1$ to $4$. So we will focus on the next number, $5$, and hope it does not follow the unfortunate fate of its predecessors.
Consider the following sequence in the positive and negative indices:
Note that equality uniquely defines both the positive and the negative indices (e.g. $x_5 = 40$, $x_6 = 230$, $\dots$ and $x_{-1} = -22$, $x_{-2} = 33$, $\dots$)
You are given an array of $n$ numbers $a_1, a_2 , \dots, a_n$. Write a program five that supports $2$ types of events:
The first line of the standard input contains the numbers $n$ and $q$. The next line contains $n$ integers $a_1, a_2 ,\dots , a_n$. Each of the following $q$ lines contains $3$ natural numbers $type$, $l$, $r$.
For each Query, print on a new line the answer for that query.