#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cmath>
#include <iomanip>
#include <cassert>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) (int)(x).size()
using namespace std;
using ll = long long;
constexpr ll INF = 3000000000000000000;

template <typename Operator>
struct LazySegmentTree {
    Operator OP;
    using NodeType = decltype(OP.NodeE);
    using FuncType = decltype(OP.FuncE);
    int length, height;
    vector<NodeType> node;
    vector<FuncType> lazy;
    
    LazySegmentTree(int n) {
        length = 1;
        height = 0;
        while (length < n) {
            length <<= 1;
            ++height;
        }
        node.resize(length << 1, OP.NodeE);
        lazy.resize(length << 1, OP.FuncE);
    }
    
    void eval(int n) {
        node[n] = OP.NodeFunc(node[n], lazy[n]);
        if (n < length) {
            lazy[(n << 1) | 0] = OP.MergeFunc(lazy[(n << 1) | 0], lazy[n]);
            lazy[(n << 1) | 1] = OP.MergeFunc(lazy[(n << 1) | 1], lazy[n]);
        }
        lazy[n] = OP.FuncE;
    }
    
    void update(int a, int b, FuncType x) {
        int l = a + length, r = b + length - 1;
        for (int i = height; i > 0; --i) {
            eval(l >> i);
            eval(r >> i);
        }
        ++r;
        while (r > l) {
            if (l & 1) {
                lazy[l] = OP.MergeFunc(lazy[l], x);
                ++l;
            }
            if (r & 1) {
                --r;
                lazy[r] = OP.MergeFunc(lazy[r], x);
            }
            l >>= 1; r >>= 1;
        }
        l = a + length; r = b + length - 1;
        while (l >>= 1) node[l] = OP.MergeNode(OP.NodeFunc(node[(l << 1) | 0], lazy[(l << 1) | 0]), OP.NodeFunc(node[(l << 1) | 1], lazy[(l << 1) | 1]));
        while (r >>= 1) node[r] = OP.MergeNode(OP.NodeFunc(node[(r << 1) | 0], lazy[(r << 1) | 0]), OP.NodeFunc(node[(r << 1) | 1], lazy[(r << 1) | 1]));
    }
    
    NodeType get(int a, int b) {
        int l = a + length, r = b + length - 1;
        for (int i = height; i >= 0; --i) {
            eval(l >> i);
            eval(r >> i);
        }
        ++r;
        NodeType vl = OP.NodeE, vr = OP.NodeE;
        while (l < r) {
            if (l & 1) vl = OP.MergeNode(vl, node[l++]);
            if (r & 1) vr = OP.MergeNode(node[--r], vr);
            l >>= 1; r >>= 1;
        }
        return OP.MergeNode(vl, vr);
    }
};

struct hoge {
    ll NodeE = 0;
    ll FuncE = INF;
    ll MergeNode(ll x, ll y) {
        return x + y;
    }
    ll MergeFunc(ll x, ll y) {
        if (y == INF) return x;
        else return y;
    }
    ll NodeFunc(ll x, ll y) {
        if (y == INF) return x;
        else return y;
    }
};

int main() {
    int n, q;
    cin >> n >> q;
    LazySegmentTree<hoge> LST(n);
    LST.update(0, n, (1LL << 31) - 1);
    REP(_, q) {
        int num;
        cin >> num;
        if (!num) {
            int s, t, x;
            cin >> s >> t >> x;
            ++t;
            LST.update(s, t, x);
        } else {
            int i;
            cin >> i;
            cout << LST.get(i, i + 1) << "\n";
        }
    }
    
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define INIVAL 2147483647

int *a, *ts, c, s, t, v;

void update(int k, int l, int r)
{
  if (r<s || t<=l) return;
  if (s<=l && r<=t) {
    a[k] = v;
    ts[k] = c;
  } else if (l<r-1) {
    update(((k+1)<<1)-1, l, (l+r)>>1);
    update((k+1)<<1, (l+r)>>1, r);
  }
}

int main()
{
  int i, k, n, z, w, latest;
  char *p,buf[64] = {0};
  buf[62] = '\n';
  fgets(buf, 64, stdin);
  for (n=0,p=buf; *p>' '; n=n*10+*(p++)-'0');
  w = n>1 ? pow(2,(int)ceil(log2(n)))-1 : 1;
  ts = (a = (int*)malloc((w+n)*2*sizeof(int))) + w+n;
  for (i=0; i<w+n; i++)  ts[i] = -1;
  a[0] = INIVAL;
  ts[0] = 0;
  c = 0;
  while (fgets(buf, 64, stdin)) {
    for (s=0,p=buf+2; *p>' '; s=s*10+*(p++)-'0');
    if (*buf=='0') { // update(s, t, x)
      for (t=0,p++; *p>' '; t=t*10+*(p++)-'0');
      for (v=0,p++; *p>' '; v=v*10+*(p++)-'0');
      t++;
      update(0, 0, w+1);
      c++;
    } else { // find(x) x->s
      latest = -1;
      for (k=w+s; ; k=(k-1)>>1) {
	if (ts[k]>latest) {
          latest = ts[k];
          z = a[k];
        }
	if (k==0) break;
      }
      if (z<10) {
	putc_unlocked('0'+z, stdout);
	putc_unlocked('\n', stdout);
      } else {
        for (i=62; z>0; buf[--i]='0'+z%10,z/=10);
        fputs(buf+i, stdout);
      }
    }
  }
  return 0;
}

