#include #include #include #include #include #include #include #include #include #include #include #define per pair #define mp make_pair #define pb push_back #define DN 100005 #define DM 500 #define f cin using namespace std; //ifstream f("test.in"); int n,m,radn,aa,bb; bool val[DN],buk[DM],full[DM]; int get_bucket(int x){ return (x/radn) + 1; } int left(int x){ int p = (x-1)*radn; return max(p,1); } int right(int x){ return x*radn - 1; } void check(int bucket){ int x = val[ left(bucket) ]; full[ bucket ] = true; for(int i = left(bucket); i<=right(bucket) && i<=n; ++i) if( val[i] != x ) full[ bucket ] = false; } void update(int st,int dr){ //cout<<" UPDATE :"<=1 ; --aa); if( get_bucket(poz) == aa ) aa = poz; else aa = left( aa + 1); if( get_bucket(poz) == bb) bb = poz; else bb = right( bb - 1); for( ; val_poz(bb) == x && bb<=n ; ++bb); --bb; for( ; val_poz(aa) == x && aa>=1 ; --aa); ++aa; return x; } void read(){ f>>n>>m; radn = sqrt(n); for(;m--;){ int op; f>>op; if(op == 1){ int a,b; f>>a>>b; update(a,b); } else{ int p; f>>p; cout<