292_E. Copying Data
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:

  1. 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. 
  2. 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.

Input

The first line contains two space-separated integers n and m (1 ≤ n, m ≤ 105) — the number of elements in the arrays and the number of queries, correspondingly. The second line contains an array of integers a1, a2, ..., an (|ai| ≤ 109). The third line contains an array of integers b1, b2, ..., bn (|bi| ≤ 109).

Next m lines contain the descriptions of the queries. The i-th line first contains integer ti — the type of the i-th query (1 ≤ ti ≤ 2). If ti = 1, then the i-th query means the copying operation. If ti = 2, then the i-th query means taking the value in array b. If ti = 1, then the query type is followed by three integers xi, yi, ki (1 ≤ xi, yi, ki ≤ n) — the parameters of the copying query. If ti = 2, then the query type is followed by integer xi (1 ≤ xi ≤ n) — the position in array b.

All numbers in the lines are separated with single spaces. It is guaranteed that all the queries are correct, that is, the copying borders fit into the borders of arrays a and b.

Output

For each second type query print the result on a single line.

Examples

Input

5 10
1 2 0 -1 3
3 1 5 -2 0
2 5
1 3 3 3
2 5
2 4
2 1
1 2 1 4
2 1
2 4
1 4 2 1
2 2


Output

0
3
-1
3
2
3
-1
```python
import sys
'''
SEGMENT TREE
Assign
'''
class SegmTree():
    '''
    - modify elements on interval
    - get single element
    '''
    def __init__(self, size):
        N = 1
        while N < size:
            N <<= 1
        self.N = N
        self.tree = [0] * (2*N)

    def modify_range(self, l, r, value):
        l += self.N
        r += self.N
        while l < r:
            if l & 1:
                self.tree[l] = value
                l += 1
            if r & 1:
                r -= 1
                self.tree[r] = value
            l >>= 1
            r >>= 1
    
    def query(self, i):
        i += self.N
        latest_change = self.tree[i]
        p = i
        while p > 1:
            p >>= 1
            latest_change = max(latest_change, self.tree[p])
        return latest_change

# inf = open('input.txt', 'r')
# reader = (map(int, line.split()) for line in inf)
reader = (map(int, line.split()) for line in sys.stdin)
input = reader.__next__

n, m = input()
a = list(input())
b = list(input())
st = SegmTree(n)
request = [None] * (m + 1)
for i in range(1, m+1):
    t, *arg = input()
    if t == 1:
        x, y, k = request[i] = arg
        st.modify_range(y-1, y-1+k, i)
    else:
        pos = arg[0] - 1
        req_id = st.query(pos)
        if req_id > 0:
            x, y, k = request[req_id]
            ans = a[x+(pos-y)]
        else:
            ans = b[pos]
        sys.stdout.write(f'{ans}\n')

# inf.close()

```