#include <bits/stdc++.h>
using namespace std;
long long a[200010], b[200010];
struct node1 {
  long long l, r;
  long long num;
  bool lazy;
  long long sub;
  long long mark;
} node[400010];
void build(int l, int r, int x) {
  node[x].l = l;
  node[x].mark = 0;
  node[x].r = r;
  node[x].lazy = false;
  node[x].sub = 0;
  node[x].num = 0;
  if (node[x].l == node[x].r) {
    node[x].num = node[x].l;
    return;
  }
  int(node[x].l + node[x].r) / 2;
  build(l, (node[x].l + node[x].r) / 2, 2 * x);
  build((node[x].l + node[x].r) / 2 + 1, r, 2 * x + 1);
}
void pushdown(int x) {
  node[x * 2].lazy = node[x * 2 + 1].lazy = node[x].lazy;
  node[x].lazy = false;
  node[x * 2].sub = node[2 * x + 1].sub = node[x].sub;
  node[x].sub = 0;
  node[2 * x].mark = node[x * 2 + 1].mark = node[x].mark;
  node[x].mark = 0;
  if (node[x * 2].r == node[x * 2].l) {
    b[node[x * 2].num] = a[node[2 * x].num + node[2 * x].sub];
  }
  return;
}
void change(int l, int r, int x, int sub) {
  if (node[x].l == node[x].r) {
    node[x].lazy = true;
    node[x].sub = sub;
    node[x].mark = 1;
    b[node[x].num] = a[node[x].num + node[x].sub];
    return;
  }
  if (node[x].lazy) pushdown(x);
  if (l <= node[x].l && r >= node[x].r) {
    node[x].lazy = true;
    node[x].sub = sub;
    node[x].mark = 1;
    return;
  }
  int(node[x].l + node[x].r) / 2;
  if (l <= (node[x].l + node[x].r) / 2) change(l, r, 2 * x, sub);
  if (r > (node[x].l + node[x].r) / 2) change(l, r, 2 * x + 1, sub);
}
long long ans;
void query(long long pos, long long x) {
  if (node[x].l == node[x].r) {
    if (node[x].mark) {
      b[node[x].num] = a[node[x].num + node[x].sub];
      ans = b[node[x].num];
      node[x].mark = 0;
      node[x].sub = 0;
      node[x].lazy = false;
      return;
    } else {
      ans = b[node[x].num];
      return;
    }
  }
  if (node[x].lazy) {
    pushdown(x);
  }
  int(node[x].l + node[x].r) / 2;
  if (pos <= (node[x].l + node[x].r) / 2) query(pos, 2 * x);
  if (pos > (node[x].l + node[x].r) / 2) query(pos, 2 * x + 1);
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%lld", &b[i]);
  build(1, n, 1);
  int y;
  for (int i = 1; i <= m; i++) {
    scanf("%d", &y);
    if (y == 1) {
      int aa, bb, cc;
      scanf("%d%d%d", &aa, &bb, &cc);
      change(bb, bb + cc - 1, 1, aa - bb);
    }
    if (y == 2) {
      int aa;
      scanf("%d", &aa);
      query(aa, 1);
      printf("%I64d\n", ans);
    }
  }
  return 0;
}
