#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[100000 + 10];
int b[100000 + 10];
int Ans[100000 + 10];
vector<int> L[100000 + 10], R[100000 + 10], Q[100000 + 10];
struct Data {
  int flag, Time;
  int l, r;
  int x;
  bool operator>(const Data &T) const { return Time > T.Time; }
  bool operator<(const Data &T) const { return Time < T.Time; }
} f[100000 + 10];
set<Data> s;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
  int x, y, z;
  for (int i = 1; i <= m; i++) {
    scanf("%d", &f[i].flag);
    f[i].Time = i;
    if (f[i].flag == 1) {
      scanf("%d%d%d", &x, &y, &z);
      f[i].l = y;
      f[i].r = y + z;
      f[i].x = x;
      L[y].push_back(i);
      R[y + z].push_back(i);
    } else {
      scanf("%d", &f[i].x);
      Q[f[i].x].push_back(i);
    }
  }
  Data tmp, A;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < (int)L[i].size(); j++) s.insert(f[L[i][j]]);
    for (int j = 0; j < (int)R[i].size(); j++) s.erase(f[R[i][j]]);
    for (int j = 0; j < (int)Q[i].size(); j++) {
      tmp.Time = Q[i][j];
      if (s.begin() == (s.lower_bound(tmp)))
        Ans[Q[i][j]] = b[i];
      else {
        A = *(--s.lower_bound(tmp));
        Ans[Q[i][j]] = a[A.x + i - A.l];
      }
    }
  }
  for (int i = 1; i <= m; i++)
    if (f[i].flag == 2) printf("%d\n", Ans[f[i].Time]);
  return 0;
}
