We often have to copy large volumes of information. Such operation can take up many computer resources. Therefore, in this problem you are advised to come up with a way to copy some part of a number array into another one, quickly.
More formally, you've got two arrays of integers
a1,a2,...,an and
b1,b2,...,bn of length
n. Also, you've got
m queries of two types:
-
Copy the subsegment of array a of length k, starting from position x, into array b, starting from position y, that is, execute by+q=ax+q for all integer q (0≤q<k). The given operation is correct − both subsegments do not touch unexistent elements.
-
Determine the value in position x of array b, that is, find value bx.
For each query of the second type print the result − the value of the corresponding element of array
b.