#include <bits/stdc++.h>
using namespace std;
const int roz = 300000;
const int mini = -1000000003;
int tree[roz];
int dana[roz];
bool czy[roz];
int lisc;
int lis(int n) {
  int i = 1;
  while (i < n) {
    i *= 2;
  }
  return i;
}
void cop(int wez, int left, int right, int poc, int kon, int x, int y) {
  if (left == poc && right == kon) {
    tree[wez] = x + left - y;
    if (poc == kon) czy[poc] = true;
    return;
  }
  int sr = (left + right) / 2;
  if (tree[wez] != mini) {
    tree[2 * wez] = tree[wez];
    tree[2 * wez + 1] = tree[wez] + (right - left + 1) / 2;
    if (right - left == 1) {
      czy[2 * wez - lisc] = true;
      czy[2 * wez - lisc + 1] = true;
    }
    tree[wez] = mini;
  }
  if (kon <= sr) {
    cop(wez * 2, left, sr, poc, kon, x, y);
    return;
  }
  if (poc > sr) {
    cop(wez * 2 + 1, sr + 1, right, poc, kon, x, y);
    return;
  }
  cop(wez * 2, left, sr, poc, sr, x, y);
  cop(wez * 2 + 1, sr + 1, right, sr + 1, kon, x, y);
}
void val(int a) {
  int i = 1;
  int l = 0;
  int r = lisc - 1;
  int sr;
  while (tree[i] == mini) {
    sr = (l + r) / 2;
    if (a > sr) {
      i = 2 * i + 1;
      l = sr + 1;
    } else {
      i *= 2;
      r = sr;
    }
  }
  if (l == r && !czy[i - lisc]) {
    printf("%d\n", tree[i]);
  } else {
    printf("%d\n", dana[tree[i] + a - l]);
  }
}
int main() {
  int n, m, q;
  int a, b, c;
  scanf("%d %d", &n, &m);
  lisc = lis(n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &dana[i]);
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &tree[lisc + i]);
  }
  for (int i = 0; i < lisc; i++) {
    tree[i] = mini;
    czy[i] = false;
  }
  for (int i = 0; i < m; i++) {
    scanf("%d", &q);
    if (q == 1) {
      scanf("%d %d %d", &a, &b, &c);
      cop(1, 0, lisc - 1, b - 1, b + c - 2, a - 1, b - 1);
      for (int j = 1; j <= lisc; j = 2 * j) {
      }
    } else {
      scanf("%d", &a);
      val(a - 1);
    }
  }
  return 0;
}
