#include <bits/stdc++.h>

using namespace std;

inline int readNr()
{
    register int a = 0;
    char ch;

    do
    {
        ch = getchar();

    } while ( !isdigit(ch) );

    do
    {
        a = ( a << 3 ) + ( a << 1 ) + ch - '0';
        ch = getchar();

    } while ( isdigit(ch) );

    return a;
}

const int Nmax = 50000 + 1;

int v[Nmax];
int N, M;

void update(int x, int y, int val)
{
    for ( int i = x; i <= y; ++i )
        v[i] = val;
}

void query(int x)
{
    cout << v[x] << " ";

    int st, dr;

    for ( int i = x; i >= 1; i-- )
    {
        if ( v[i] != v[x] ) break;
        st = i;
    }

    for ( int i = x; i <= N; ++i )
    {
        if ( v[i] != v[x] ) break;
        dr = i;
    }

    cout << st << " " << dr << "\n";
}

int main()
{
    ///freopen("data.in", "r", stdin);

    N = readNr(); M = readNr();

    while ( M-- )
    {
        int tip, a, b, c;

        tip = readNr();;

        if ( tip == 1 )
        {
            a = readNr(); b = readNr(); c = readNr();
            update(a, b, c);
        }
        else
        {
            a = readNr();
            query(a);
        }
    }

    return 0;
}