Ivan is writing down numbers in his notebook. In the beginning he has a set of integers S written down. Afterwards, he may write down new numbers in his notebook, by using the following operations:
Denote by f(S) the minimal number Ivan can write down in his notebook for the starting set S.
You are given an array of length N and Q queries where you have to perfortm one of the following operations:
In the first line of input is the numbers N (N≤100000): the length of the array.
In the second line of input is N integers a\[1],a\[2],⋯,a\[N] (0\<a\[i]<262), the elements of a.
In the thirst line of input is the number Q (Q≤100000): the number of queries.
The following Q lines describe the queires. A query can either be of the format "1 x y" meaning set a\[x] (1≤x≤N) to y (0\<y<262), or of the format "2 l r" meaning find the value of f(a\[L],a\[L+1],⋯,a\[R]) (1≤L≤R≤N).
For every query of type two print the value of f(a\[L],a\[L+1],⋯,a\[R]) in a single line.