#include <iostream>
#include <algorithm>
#include <string>
#include <fstream>
#include <vector>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <list>
#include <bitset>

using namespace std;
typedef long long ll;

// #define DEBUG

class RangeAddorUpdateQuery // 0-index
{
    int const intmax = 2147483647;
    int const intmin = 0;
    vector<int> segtree;
    vector<int> lazytree;
    int n;
    int k;

public:
    RangeAddorUpdateQuery(int n1, int f = -1)
    {
        if (f == -1)
            f = intmax;
        else if (f == 0)
            f = intmin;
        int na = 1;
        int ka = 0;
        while (na < n1)
        {
            na *= 2;
            ka++;
        }
        for (int i = 0; i < 2 * na; i++)
        {
            segtree.push_back(f);
            lazytree.push_back(f);
        }
        n = na;
        k = ka;
    }

    void lazyevaluation(int k, int l, int r)
    {
        if (lazytree[k] != intmax)
        {
            segtree[k] = lazytree[k];
            if (r - l > 1) //最下段以外は一段下に伝播
            {
                lazytree[2 * k + 1] = lazytree[k];
                lazytree[2 * k] = lazytree[k];
            }
            lazytree[k] = intmax;
        }
    }

    void rangeupdate(int a, int b, int x, int k = 1, int l = 0, int r = -1) //閉区間 l <= x < r とする
    {
        if (r == -1)
            r = n;
        lazyevaluation(k, l, r);
        if (r <= a || b <= l)
            return;
        if (a == l && b == r)
        {
            lazytree[k] = x;
            lazyevaluation(k, l, r);
        }
        else
        {
            rangeupdate(a, min(b, (l + r) / 2), x, 2 * k, l, (l + r) / 2);
            rangeupdate(max(a, (l + r) / 2), b, x, 2 * k + 1, (l + r) / 2, r);
        }
    }

    int getmin(int a, int b, int k = 1, int l = 0, int r = -1) //閉区間 l <= x < r とする
    {
        if (r == -1)
            r = n;
        lazyevaluation(k, l, r);
        if (r <= a || b <= l)
            return intmax;
        if (a == l && b == r)
            return segtree[k];
        else
            return min(getmin(a, min(b, (l + r) / 2), 2 * k, l, (l + r) / 2), getmin(max(a, (l + r) / 2), b, 2 * k + 1, (l + r) / 2, r));
    }
    int getmax(int a, int b, int k = 1, int l = 0, int r = -1) //閉区間 l <= x < r とする
    {
        if (r == -1)
            r = n;
        lazyevaluation(k, l, r);
        if (r <= a || b <= l)
            return intmin;
        if (a == l && b == r)
            return segtree[k];
        else
            return min(getmax(a, min(b, (l + r) / 2), 2 * k, l, (l + r) / 2), getmax(max(a, (l + r) / 2), b, 2 * k + 1, (l + r) / 2, r));
    }
    int getsum(int a, int b, int k = 1, int l = 0, int r = -1) //閉区間 l <= x < r とする
    {
        if (r == -1)
            r = n;
        lazyevaluation(k, l, r);
        if (r <= a || b <= l)
            return intmin;
        if (a == l && b == r)
        {
            return segtree[k];
        }
        else
            return getsum(a, min(b, (l + r) / 2), 2 * k, l, (l + r) / 2) + getsum(max(a, (l + r) / 2), b, 2 * k + 1, (l + r) / 2, r);
    }

    void printsegtree()
    {
        for (int i = 0; i < 2 * n; i++)
        {
            cout << segtree[i] << " ";
        }
        cout << endl;
    }
};

int main()
{

#ifdef DEBUG
    cout << "DEBUG MODE" << endl;
    ifstream in("input.txt"); //for debug
    cin.rdbuf(in.rdbuf());    //for debug
#endif

    int n, q, k, c, s, t, x;
    cin >> n >> q;
    RangeAddorUpdateQuery segtree(n);

    for (int i = 0; i < q; i++)
    {
        cin >> c;
        if (c == 0)
        {
            cin >> s >> t >> x;
            segtree.rangeupdate(s, t + 1, x);
        }
        else
        {
            cin >> x;
            cout << segtree.getsum(x, x + 1) << endl;
        }
    }
    return 0;
}

// getline(cin,s);
// a = strtok(s, ",");  ","で分解
// for (int i = 0; i < n; i++)


Measured memory_bytes: 5060