#include <bits/stdc++.h>
struct type {
  int v;
  int la, ra;
  bool push;
  int l, r;
};
type b[1048577];
int a[1048577];
void push(int num) {
  if (b[num].l == b[num].r || !b[num].push) return;
  b[num].push = false;
  b[2 * num + 1].push = true;
  b[2 * num + 1].la = b[num].la;
  int di = b[2 * num + 1].r - b[2 * num + 1].l;
  b[2 * num + 1].ra = b[num].la + di;
  b[2 * num + 2].push = true;
  b[2 * num + 2].la = b[num].la + di + 1;
  b[2 * num + 2].ra = b[num].ra;
}
void change(int num, int Bi, int Ai, int count) {
  if (b[num].r < Bi || Bi + count < b[num].l) return;
  push(num);
  if (Bi <= b[num].l && b[num].r <= Bi + count) {
    int db = b[num].l - Bi;
    b[num].la = Ai + db;
    b[num].ra = b[num].la + count;
    b[num].push = true;
    return;
  }
  if (b[num].l == b[num].r) return;
  change(num * 2 + 1, Bi, Ai, count);
  change(num * 2 + 2, Bi, Ai, count);
}
int getv(int num, int cur) {
  push(num);
  if (b[num].l == b[num].r) {
    if (b[num].push) return a[b[num].la];
    return b[num].v;
  }
  if (cur <= b[num * 2 + 1].r) return getv(num * 2 + 1, cur);
  return getv(num * 2 + 2, cur);
}
int main() {
  int N, M, i, K, t, x, y, size;
  scanf("%d%d", &N, &M);
  for (K = 1; K < N; K *= 2)
    ;
  for (i = 1; i <= N; i++) scanf("%d", &a[i]);
  for (i = 0; i < K; i++) {
    if (i < N) scanf("%d", &b[i + K - 1].v);
    b[i + K - 1].l = i + 1;
    b[i + K - 1].r = i + 1;
    b[i + K - 1].push = false;
  }
  for (i = K - 2; i >= 0; i--) {
    b[i].push = false;
    b[i].l = b[2 * i + 1].l;
    b[i].r = b[2 * i + 2].r;
  }
  for (i = 0; i < M; i++) {
    scanf("%d", &t);
    if (t == 1) {
      scanf("%d%d%d", &x, &y, &size);
      change(0, y, x, size - 1);
    } else {
      scanf("%d", &x);
      printf("%d\n", getv(0, x));
    }
  }
  return 0;
}
