#include <iostream>
#include <vector>
using namespace std;

class SegTree{
private:
  int n;
  // 1-index (tree[0] is dummy), leaves are tree[n]-tree[2n-1]
  vector<int> tree;
  const int defVal = 2147483647;
public:
  SegTree(int _n){
    int t;
    t = 1;
    while (t<_n) t*=2;
    n = t;
    tree = vector<int>(2*n, defVal);
    //cerr << "finish init" << endl;
    //cerr << "tree size is " << 2*n << endl;
  }
  // stab function
  void update(int l, int r, int x){ return _update(l,r,x,1,0,n);}
  void _update(int l, int r, int x, int k, int kl, int kr){
//    cerr << "update: "<<l<<" "<<r<<" "<<x<<" "<<k<<" "<<kl<<" "<<kr<<endl;
    if (kr<=l || r<=kl) return;
    else if (l<=kl && kr<=r){
      tree[k] = x;
      return;
    } else {
      if (tree[k]!=defVal){
        tree[k*2]=tree[k]; tree[k*2+1]=tree[k];
        tree[k]=defVal;
      }
      _update(l,r, x, k*2, kl,(kl+kr)/2);
      _update(l,r, x, k*2+1, (kl+kr)/2,kr);
    }
  }
  int find(int i){
    return _find(i,1,0,n);
  }
  int _find(int i, int k, int kl, int kr){
//    cerr << "find: "<<i<<" "<<k<<" "<<kl<<" "<<kr<<endl;
    if (k>=n || tree[k]!=defVal) return tree[k];
    if (i<(kl+kr)/2) return _find(i, k*2, kl,(kl+kr)/2);
    else return _find(i, k*2+1, (kl+kr)/2,kr);
  }
  // debug
  void print(){
    cerr << "debug: ";
    for (int i=1; i<2*n; i++){
      if (i==n) cout << "| ";
      if (tree[i]==defVal) cout << "DV ";
      else cout << tree[i] << " ";
    }
    cout << endl;
  }
};

int main(void){
  int n,q;
  SegTree *st;
  
  cin >> n >> q;
  st = new SegTree(n);
  for (int i=0; i<q; i++){
    int c,s,t,x,id;
    cin >> c;
    if (c==0){
      cin >> s >> t >> x;
      st->update(s,t+1,x);
    }
    else if (c==1){
      cin >> id;
      cout << st->find(id) << endl;
    }
    else cout << "illegal command" << endl;
    //st->print();
  }
  return 0;
}
