#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=1;i<=n;i++)
#define drep(i,n) for(int i=n;i>=0;i--)
#define MAX 100000
#define ll long long
#define dmp make_pair
#define dpb push_back
#define P pair<int,int>
#define fi first
#define se second
using namespace std;
//__gcd(a,b), __builtin_popcount(a);
const int INF = 2147483647;
#define B 1000
 
int bucket[MAX/B][B];
int data[MAX/B];
void update(int a, int b, int x){
    int f1 = 1, f2 = 1;
    while(a <= b && a%B != 0){
        if(f1 && data[a/B] != -1){
            for(int i = 0;i < B;i++)bucket[a/B][i] = data[a/B];
            f1 = 0;data[a/B] = -1;
        }
        bucket[a/B][a%B] = x;
        a++;
    }
    while(a <= b && b%B != B-1){
        if(f2 && data[b/B] != -1){
            for(int i = 0;i < B;i++)bucket[b/B][i] = data[b/B];
            f2 = 0;data[b/B] = -1;
        }
        bucket[b/B][b%B] = x;
        b--;
    }
    while(a < b){
        data[a/B] = x;
        a += B;
    }
}
 
int find(int x){
    if(data[x/B] != -1){
        for(int i = 0;i < B;i++)bucket[x/B][i] = data[x/B];
        data[x/B] = -1;
    }
    return bucket[x/B][x%B];
}
 
int main(){
    int n, q, c, s, t, x, ans;
    scanf("%d%d", &n, &q);
    fill(data, data+MAX/B, -1);
    fill((int*)bucket, (int*)(bucket+MAX/B), INF);
    while(q--){
        scanf("%d", &c);
        if(!c){
            scanf("%d%d%d", &s, &t, &x);
            update(s, t, x);
        }else{
            scanf("%d", &x);
            ans = find(x);
            printf("%d\n", ans);
        }
    }
    //rep(i,n)printf("%d ", bucket[0][i]);
    return 0;
}