#SGM0000044. Sao chép dữ liệu (Copying Data)

Sao chép dữ liệu (Copying Data)

Copying Data

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Given arrays AA and BB, copy a subarray of AA into a corresponding subarray of BB and query single positions of BB.

Input

The first line contains n,mn,m, followed by arrays AA and BB. Queries are:

  • 1 x y k: for 0≤d<k0\le d<k, set By+d=Ax+dB_{y+d}=A_{x+d}.
  • 2 x: print BxB_x.

Every copy range is guaranteed to fit both arrays.

Output

Print one line for every type 2 query.

Subtasks

  • 20 points: n,m≤50n,m\le50.
  • 30 points: n,m≤5000n,m\le5000.
  • 50 points: n,m≤105n,m\le10^5, ∣Ai∣,∣Bi∣≤109|A_i|,|B_i|\le10^9.

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

Explanation

Copy operations never modify AA; they only replace covered positions of BB. Because copy ranges may overlap, a point query must use the most recent assignment covering that position. The outputs are 0 3 -1 3 2 3 -1.