#include <bits/stdc++.h>
using namespace std;
int n, m, array1[100001], brray1[100001], st[400101], t, l, r, x, y, k;
void upd(int a, int b, int index, int val) { st[index] = val; }
void update(int a, int b, int l1, int r1, int index, int val) {
  if (l1 > b or r1 < a) return;
  if (l1 <= a and b <= r1) {
    st[index] = val;
  } else {
    if (st[index] != 0 and a != b) {
      upd(a, (a + b) / 2, 2 * index, st[index]);
      int diff = ((a + b) / 2 - a + 1);
      upd((a + b) / 2 + 1, b, 2 * index + 1, (st[index] + diff));
      st[index] = 0;
    }
    int mid = (a + b) / 2 + 1;
    update(a, (a + b) / 2, l1, r1, 2 * index, val);
    if (mid <= r1) {
      int s = val + (mid - l1);
      if (mid < l1) s = val;
      update((a + b) / 2 + 1, b, max(mid, l1), r1, 2 * index + 1, s);
    }
  }
}
int query(int a, int b, int index) {
  if (x < a or x > b)
    return 0;
  else if (a == b) {
    return st[index];
  } else {
    if (st[index] == 0) {
      int temp = query(a, (a + b) / 2, 2 * index);
      if (temp == 0) temp = query((a + b) / 2 + 1, b, 2 * index + 1);
      return temp;
    } else {
      int diff = (x - a);
      return (st[index] + diff);
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> array1[i];
  for (int i = 1; i <= n; i++) cin >> brray1[i];
  for (int i = 0; i < m; i++) {
    cin >> t;
    if (t == 1) {
      cin >> x >> l >> k;
      r = l + (k - 1);
      y = x + (k - 1);
      update(1, n, l, r, 1, x);
    } else {
      cin >> x;
      int temp = query(1, n, 1);
      if (temp == 0)
        cout << brray1[x] << "\n";
      else
        cout << array1[temp] << "\n";
    }
  }
}
