#include using namespace std; const int BS = 1 << 16; char buffer[BS]; int position = BS; inline char Getchar() { if ( position == BS ) { position = 0; fread( buffer, BS, 1, stdin ); } return buffer[ position++ ]; } 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) { int st = 0, dr = 0; 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; } printf("%d %d %d\n", v[x], st, dr); } 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; }