#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <cstdint>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};

template<class T> class LazySegmentTree {
    public:
    size_t n;       // 葉の数
    vector<T> data; // データ
    vector<T> lazy; // 遅延評価用
    T unit;         // 単位元
    T def;          // 初期値
    function<T(T, T)> update_func;      // 更新で使う処理
    function<T(T, T)> find_func;        // クエリで使う処理
    function<T(T, T)> lazy_prop_func;   // 遅延評価用の値を子ノードに伝播させる処理

    LazySegmentTree(
        size_t _n, T _unit, T _def,  
        function<T(T, T)> _update_func, 
        function<T(T, T)> _find_func, 
        function<T(T, T)> _lazy_prop_func
        ) : unit(_unit), def(_def), update_func(_update_func), find_func(_find_func), lazy_prop_func(_lazy_prop_func) {
        // 2のべき乗にする
        n = 1;
        while(n < _n) n <<= 1;
        data = vector<T>(2*n-1, _def);
        lazy = vector<T>(2*n-1, _def);
    }

    void eval(size_t k, size_t kl, size_t kr) {
        if(lazy[k] == def) return;
        // if(data[k] != def) data[k] = unit;
        data[k] = update_func(data[k], lazy[k]);
        if(kr - kl > 1){
            lazy[2*k+1] = lazy_prop_func(lazy[2*k+1], lazy[k]);
            lazy[2*k+2] = lazy_prop_func(lazy[2*k+1], lazy[k]);
        }
        lazy[k] = def;
    }

    void _update(size_t s, size_t t, size_t k, size_t kl, size_t kr, T x){
        eval(k, kl, kr);

        if(t <= kl || kr <= s) return;
        if(s <= kl && kr <= t) {
            lazy[k] = lazy_prop_func(lazy[k], x);
            eval(k, kl, kr);
        } else {
            size_t kc = (kl+kr)/2;
            _update(s, t, 2*k+1, kl, kc, x);
            _update(s, t, 2*k+2, kc, kr, x);
            data[k] = find_func(data[2*k+1], data[2*k+2]);
        }
    }

    void update(size_t s, size_t t, T x) {
        return _update(s, t, 0, 0, n, x);
    }

    T _find(size_t s, size_t t, size_t k, size_t kl, size_t kr){
        if(kr <= s || t <= kl) return unit;

        eval(k, kl, kr);
        if(s <= kl && kr <= t) return data[k];

        size_t kc = (kl+kr)/2;
        T vl = _find(s, t, 2*k+1, kl, kc);
        T vr = _find(s, t, 2*k+2, kc, kr);
        return find_func(vl, vr);
    }
    
    T find(size_t s, size_t t) {
        return _find(s, t, 0, 0, n);
    }
};

int main() {
    unsigned int n, q, com, s, t, x;
    cin >> n >> q;
    LazySegmentTree<ll> tree(
        n, 0LL, (1LL << 31) - 1, 
        [](ll a, ll b) { return b; }, 
        [](ll a, ll b) { return a+b; }, 
        [](ll a, ll b) { return b; }
    );

    while(q--) {
        cin >> com;
        if(com) {
            cin >> s;
            cout << tree.find(s, s+1) << endl;
        } else {
            cin >> s >> t >> x;
            tree.update(s, t+1, x);
        }
    }
    
}


Measured memory_bytes: 7076