#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main()
{
    int y,k,n;
    cin >> y >> k >> n;
    int x=1;
    for(;x+y<=n;x++)
    {
    if((x+y)%k==0)
        cout << x << " ";
    }
    if(x==1) cout << -1 << "\n";
    return 0;
}


#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main()
{
    freopen("input.txt","r",stdin);
    int y,k,n;
    cin >> y >> k >> n;
    int x=2;
    for(;x+y<=n;x++)
    {
    if((x+y)%k==0)
        cout << x << "\n";
    }
    if(x==2) cout << -1;
    return 0;
}


#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main()
{
    freopen("input.txt","r",stdin);
    int y,k,n;
    cin >> y >> k >> n;
    int x=2;
    for(;x+y<=n;x++)
    {
    if((x+y)%k==0)
        cout << x << "\n";
    }
    if(x==2) cout << -1 << "\n";
    return 0;
}


#include<iostream>
using namespace std;
//total=(x+y)/k<=n it's the rule in problem
//total*k<=n loop
//x==(total*k-y) which is mean total*k>y
//x>=1 so that total*k-y>0
int main()
{
	int y, k, n;
	cin >> y >> k >> n;
	bool flag = false;
	for (int total = 1; total*k <= n; total++)
	{
		if ((total*k) > y && (total*k - y) > 0)
		{
			cout << total*k - y << " ";
			flag = true;
		}
	}
	if (flag == true)
		cout << endl;
	else
		cout << "-1" << endl;
	return 0;
}


#include<iostream>
#include<algorithm>
unsigned a[100000000] = { -1 };
using namespace std;
int main()
{
	int x = 1, y, k, n;
	cin >> y >> k >> n;
	if (k > y)
		x = k - y;
	int i = 0;
	//cout << "X = " << x << endl;
	for (; (x + y) <= n; x++)
	{
		if  ((x + y) % k == 0)
		{
			a[i] = x;
			i++;
		}
	}
	if (a[0] == -1)
		cout << "-1" << endl;
	else
	{
		sort(a, a + i);
		for (int j = 0; j < i; j++)
			cout << a[j] << " ";
		cout << endl;
	}
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int y, k, n,t=1;
	cin >> y >> k >> n;
	if ((n - y) > 0 && (t*k - y)>0)
	{
		for (; t*k <= n; t++)
		{
			if ((t*k) >y )
				cout << t*k-y << " ";
		}
		cout << endl;
	}
	else
		cout << "-1" << endl;
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int y, k, n, x=1;
	cin >> y >> k >> n;
	bool flag = false;
	if (k >= y)
		x = k;
	for (; (x + y) <= k*k; x++)
	{
		if ( (x + y) % k == 0 && (x + y) <= n )
		{
			flag = true;
			cout << x << " ";
		}
	}
	if (flag == false)
		cout << "-1" << endl;
	else
		cout << endl;
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int y, k, n;
	cin >> y >> k >> n;
	bool flag = false;
	for (int t = 1; t*k <= n; t++)
		{
			if ((t*k) > y && (t*k - y) > 0)
			{
				cout << t*k - y << " ";
				flag = true;
			}
		}
	if (flag==true)
		cout << endl;
	else
		cout << "-1" << endl;
	return 0;
}


#include<iostream>
using namespace std;
//t=(x+y)/k<=n it's the rule in problem
//t*k<=n loop
//x==(t*k-y) which is mean t*k>y
//x>=1 so that t*k-y>0
int main()
{
	int y, k, n;
	cin >> y >> k >> n;
	bool flag = false;
	for (int t = 1; t*k <= n; t++)
		{
			if ((t*k) > y && (t*k - y) > 0)
			{
				cout << t*k - y << " ";
				flag = true;
			}
		}
	if (flag==true)
		cout << endl;
	else
		cout << "-1" << endl;
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int y, k, n;
	cin >> y >> k >> n;
	if ((n - y) > 0)
	{
		for (int t = 1; t*k <= n; t++)
		{
			if ((t*k) >y)
				cout << t*k-y << " ";
		}
		cout << endl;
	}
	else
		cout << "-1" << endl;
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int y, k, n, x=1;
	cin >> y >> k >> n;
	bool flag = false;
	if (k >= y)
		x = k;
	for (; (x + y) <= n; x++)
	{
		if ( (x + y) % k == 0 )
		{
			flag = true;
			cout << x << " ";
		}
	}
	if (flag == false)
		cout << "-1" << endl;
	else
		cout << endl;
	return 0;
}


#include<iostream>
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(v) ((int)v.size())
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
#define reprng(i,a,b) for(int i = a; i <= (int)(b); ++i)
#define reprngr(i,n,a) for(int i = n;i >= (int)(a); --i)
#define For(it,c) for(auto  it=c.begin();it!=c.end();++it)
typedef long long ll;

int main()
{

	int  y, k, n;
	bool flag = false;
	cin >> y >> k >> n;
	for(int i = 1; i * k <= n && y < n; ++i)
	{
		if (i * k > y)
		{
			cout << i * k - y << " ";
			flag = true;
		}
	}
	if (!flag)
		cout << -1;

	return 0;
}


#include<iostream>
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(v) ((int)v.size())
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
#define reprng(i,a,b) for(int i = a; i <= (int)(b); ++i)
#define reprngr(i,n,a) for(int i = n;i >= (int)(a); --i)
#define For(it,c) for(auto  it=c.begin();it!=c.end();++it)
typedef long long ll;

int main()
{

	int  y, k, n;
	bool flag = false;
	cin >> y >> k >> n;
	for(int i = 2; i * k <= n && y < n; ++i)
	{
		if (i * k > y)
		{
			cout << i * k - y << " ";
			flag = true;
		}
	}
	if (!flag)
		cout << -1;

	return 0;
}


#include<iostream>
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(v) ((int)v.size())
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
#define reprng(i,a,b) for(int i = a; i <= (int)(b); ++i)
#define reprngr(i,n,a) for(int i = n;i >= (int)(a); --i)
#define For(it,c) for(auto  it=c.begin();it!=c.end();++it)
typedef long long ll;

int main()
{

	int  y, k, n;
	bool flag = false;
	cin >> y >> k >> n;
	reprng(i, y + 1, n)
	{
		if (i % k == 0)
		{
			cout << abs(y - i) << " ";
			flag = true;
		}

	}
	if (!flag)
		cout << -1;

	return 0;
}


#include<iostream>
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(v) ((int)v.size())
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
#define reprng(i,a,b) for(int i = a; i <= (int)(b); ++i)
#define reprngr(i,n,a) for(int i = n;i >= (int)(a); --i)
#define For(it,c) for(auto  it=c.begin();it!=c.end();++it)
typedef long long ll;

int main()
{

	int  y, k, n;
	bool flag = false;
	cin >> y >> k >> n;
	for(int i = 2; i * k <= n && y < n; ++i)
	{
		cout << i * k - y << " ";
		flag = true;
	}
	if (!flag)
		cout << -1;

	return 0;
}


#include <iostream>
#include <cstdio>
using namespace std;
int main ()
{
    int y,k,n,x,r,s,i;
    int ar[100000];
    while (scanf("%d%d%d",&y,&k,&n)==3)
    {
        if ((n-y)<1)
        { x=-1;
        printf("%d\n",x);
        }
        else
        {
            r=n-y;
            s=(y/k)+1;
            int p=0;
            for (i=s;;i++)
            {
                ar[p]=(k*i)-y;
                p++;
                if (ar[p-1]>r) break;
                }
                for (i=0;i<(p-1);i++)
                {
                    printf("%d",ar[i]);
                    if (i<(p-2)) printf(" ");
                    else if (i==(p-2)) printf("\n");
                    }
            }
            //return 0;

        }
    return 0;
        }


#include <iostream>
#include <cstdio>
using namespace std;
int main ()
{
    int y,k,n,x,r,s,i;
    int ar[100000];
    while (scanf("%d%d%d",&y,&k,&n)==3)
    {
        if ((n-y)<1)
        { x=-1;
        printf("%d\n",x);
        }
        else
        {
            r=n-y;
            s=(y/k)+1;
            int p=0;
            for (i=s;;i++)
            {
                ar[p]=(k*i)-y;
                p++;
                if (ar[p-1]>r) break;
                }
                for (i=0;i<(p-1);i++)
                {
                    printf("%d",ar[i]);
                    ar[i]=0;
                    if (i<(p-2)) printf(" ");
                    else if (i==(p-2)) printf("\n");
                    }
            }
            //return 0;

        }
    return 0;
        }


#include <iostream>
#include <cstdio>
using namespace std;
int main ()
{
    long long int i,y,k,n,s,r,j;
    long long int ar[100000];
    while (cin>>y>>k>>n)
    {
        long long int sum=0;
        if (n-y<=0) printf("-1\n");
        else
        {
            s=n-y;
            r=(y/k)+1;
            //cout<<r<<endl;
            //j=1;

            ar[0]=(k*r)-y;
            sum=ar[0];
            for (i=00;;i++)
            {
                //i++
                //sum=sum+k;
                if ((sum+y+(i*k))>n) break;
                cout<<(sum+(i*k))<<" ";
                //ar[i]=sum;
                //if ((sum+y)>n) break;
                }
                cout<<endl;
        /*  for (j=0;j<i;j++)
            {
                printf("%lld",ar[j]);
                if (j<(i-1)) printf(" ");
                else if (j==(i-1)) printf("\n");
                }
                */

                        }

        }
        return 0;
    }


#include <iostream>
#include <cstdio>
using namespace std;
int main ()
{
    long long int i,y,k,n,s,r,j;
    long long int ar[100000];
    while (cin>>y>>k>>n)
    {
        long long int sum=0;
        long long int x=k-(y%k);
        if ((n-y)<=0||((x+y)>n) )printf("-1\n");
        else
        {
            s=n-y;
            r=(y/k)+1;
            //cout<<r<<endl;
            //j=1;

            ar[0]=(k*r)-y;
            sum=ar[0];
            for (i=00;;i++)
            {
                //i++
                //sum=sum+k;
                if ((sum+y+(i*k))>n) break;
                cout<<(sum+(i*k))<<" ";
                //ar[i]=sum;
                //if ((sum+y)>n) break;
                }
                cout<<endl;
        /*  for (j=0;j<i;j++)
            {
                printf("%lld",ar[j]);
                if (j<(i-1)) printf(" ");
                else if (j==(i-1)) printf("\n");
                }
                */

                        }

        }
        return 0;
    }


#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#define M_PI 3.14159265358979323846
using namespace std;
const double EPS = 1e-9;const double INF = 1e+9;
typedef pair<int,int> PP;typedef long long LL;
//scanf("%d",&n);
//printf("%d",);

int main()
{
    int y,k,n,f=1;
    cin>>y>>k>>n;
    for(int i=1;i+y<=n;i++)
        if((i+y)%k==0){cout<<i<<" ";f=0;}
    if(f)cout<<-1;
}


#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#define M_PI 3.14159265358979323846
using namespace std;
const double EPS = 1e-9;const double INF = 1e+9;
typedef pair<int,int> PP;typedef long long LL;
//scanf("%d",&n);
//printf("%d",);

int main()
{
    long long y,k,n,f=0;
    cin>>y>>k>>n;
    for(int i=1;i+y<=n;i++){
        if((i+y)%k==long long(0)){printf("%d ",i);f++;}
        //if(f>1000){cout<<"!";return 0;}
    }
    if(f==0)cout<<-1;
}


#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#define M_PI 3.14159265358979323846
using namespace std;
const double EPS = 1e-9;const double INF = 1e+9;
typedef pair<int,int> PP;typedef long long LL;
//scanf("%d",&n);
//printf("%d",);

int main()
{
    int y,k,n,f=1;
    cin>>y>>k>>n;
    for(int i=1;i+y<=n;i++)
        if((i+y)%k==0){printf("%d ",i);f=0;}
    if(f)cout<<-1;
}


#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#define M_PI 3.14159265358979323846
using namespace std;
const double EPS = 1e-9;const double INF = 1e+9;
typedef pair<int,int> PP;typedef long long LL;
//scanf("%d",&n);
//printf("%d",);

int main()
{
    int y,k,n,f=0;
    cin>>y>>k>>n;
    for(int i=1;(i+y)*k<=n;i++){
        if((i+y)%k==0){printf("%d ",i);f++;}
        //if(f>1000){cout<<"!";return 0;}
    }
    if(f==0)cout<<-1;
}


#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#define M_PI 3.14159265358979323846
using namespace std;
const double EPS = 1e-9;const double INF = 1e+9;
typedef pair<int,int> PP;typedef long long LL;
//scanf("%d",&n);
//printf("%d",);

int main()
{
    int y,k,n,f=0;
    cin>>y>>k>>n;
    for(int i=1;i+y<=n;i++){
        if((i+y)%k==0){printf("%d ",i);f++;}
        if(f>1000*1000*10)cout<<"!";
    }
    if(f==0)cout<<-1;
}


#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#define M_PI 3.14159265358979323846
using namespace std;
const double EPS = 1e-9;const double INF = 1e+9;
typedef pair<int,int> PP;typedef long long LL;
//scanf("%d",&n);
//printf("%d",);

int main()
{
    int y,k,n,f=0;
    cin>>y>>k>>n;
    for(int i=1;(i+y)*(i+y)<=n;i++){
        if((i+y)%k==0){printf("%d ",i);f++;}
        //if(f>1000){cout<<"!";return 0;}
    }
    if(f==0)cout<<-1;
}


#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#define M_PI 3.14159265358979323846
using namespace std;
const double EPS = 1e-9;const double INF = 1e+9;
typedef pair<int,int> PP;typedef long long LL;
//scanf("%d",&n);
//printf("%d",);

int main()
{
    int y,k,n,f=0;
    cin>>y>>k>>n;
    for(int i=1;i+y<=n;i++){
        if((i+y)%k==0){printf("%d ",i);f++;}
        if(f>1000*1000){cout<<"!";return 0;}
    }
    if(f==0)cout<<-1;
}


#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#define M_PI 3.14159265358979323846
using namespace std;
const double EPS = 1e-9;const double INF = 1e+9;
typedef pair<int,int> PP;typedef long long LL;
//scanf("%d",&n);
//printf("%d",);

int main()
{
    int y,k,n,f=1;;
    cin>>y>>k>>n;
    for(int x=k-y;x+y<=n;x+=k){
        if(x>0){printf("%d ",x);f=0;}
    }
    if(f)cout<<-1;
}


#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#define M_PI 3.14159265358979323846
using namespace std;
const double EPS = 1e-9;const double INF = 1e+9;
typedef pair<int,int> PP;typedef long long LL;
//scanf("%d",&n);
//printf("%d",);

int main()
{
    int y,k,n,f=0;
    cin>>y>>k>>n;
    for(int i=1;i+y<=n;){
        if((i+y)%k==0){printf("%d ",i);f++;i+=k;}
        else
            i++;
    }
    if(f==0)cout<<-1;
}


#include<iostream>
using namespace std;
int main()
{
	int n, k, y, x;
	cin >> y >> k >> n;
	x = ((n / k)*k - y);
	if (x == 0)
	{
		cout << -1;
		return 0;
	}
	for (int i = x%k; i <= x; i += k)
		cout << i << " ";

	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int n, k, y, x;
	cin >> y >> k >> n;
	x = ((n / k)*k - y);
	if (x <= 0)
	{
		cout << -1;
		return 0;
	}
	for (int i = x%k; i <= x; i += k)
	if (i>0)
		cout << i << " ";

	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int n, k, y, x;
	cin >> y >> k >> n;
	x = ((n / k)*k - y);
	if (x == 0 || x%k + y == n)
	{
		cout << -1;
		return 0;
	}
	for (int i = x%k; i <= x; i += k)
	if (i>0)
		cout << i << " ";

	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int n, k, y, x;
	cin >> y >> k >> n;
	x = ((n / k)*k - y);
	if (x ==0)
	{
		cout << -1;
		return 0;
	}
	for (int i = x%k; i <= x; i += k)
	if (i>0)
		cout << i << " ";

	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int n, k, y, x;
	cin >> y >> k >> n;
	x = ((n / k)*k - y);
	if (x == 0)
	{
		cout << -1;
		return 0;
	}
	for (int i = x%k; i <= x; i += k)
	if (i>0)
		cout << i << " ";

	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int n, k, y, x;
	cin >> y >> k >> n;
	x = ((n / k)*k - y);
	if (x <k)
	{
		cout << -1;
		return 0;
	}
	for (int i = x%k; i <= x; i += k)
	if (i>0)
		cout << i << " ";

	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int n, k, y, x;
	cin >> y >> k >> n;
	x = ((n / k)*k - y);
	if (x <k)
	{
		cout << -1;
		return 0;
	}
	for (int i = x%k; i <= x; i += k)
		cout << i << " ";

	return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cctype>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;

int main()
{
    int y, k, n, x;
    cin >> y >> k >> n;
    if( y % k == 0 )
    {
        x = k;
    }
    else
    {
        x = ((y / k) + 1) * k - y;
    }
    bool hasRes = false;
    while(y + x < n)
    {
        hasRes = true;
        cout << x << " ";
        x += k;
    }
    if(!hasRes)
        cout << -1;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cctype>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;

int main()
{
    long long y, k, n, x;
    cin >> y >> k >> n;
    bool hasRes = false;
    if( y % k == 0 )
    {
        x = k;
    }
    else
    {
        x = (y / k + 1) * k - y;
    }
    while(y + x <= n)
    {
        hasRes = true;
        printf("%d ", x);
        x += k;
    }
    if(!hasRes)
        printf("-1");
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cctype>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;

int main()
{
    long long y, k, n, x;
    scanf("%d%d%d", &y, &k, &n);
    bool hasRes = false;
    if( y % k == 0 )
    {
        x = k;
    }
    else
    {
        x = (y / k + 1) * k - y;
    }
    while(y + x <= n)
    {
        hasRes = true;
        printf("%d ", x);
        x += k;
    }
    if(!hasRes)
        printf("-1");
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cctype>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;

int main()
{
    long long y, k, n, x;
    cin >> y >> k >> n;
    bool hasRes = false;
    if( y % k == 0 )
    {
        x = k;
    }
    else
    {
        x = (y / k + 1) * k - y;
    }
    while(y + x <= n)
    {
        hasRes = true;
        cout << x << " ";
        x += k;
    }
    if(!hasRes)
        cout << -1;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cctype>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;

int main()
{
    long long y, k, n, x;
    scanf("%I64d%I64d%I64d", &y, &k, &n);
    bool hasRes = false;
    if( y % k == 0 )
    {
        x = k;
    }
    else
    {
        x = (y / k + 1) * k - y;
    }
    while(y + x <= n)
    {
        hasRes = true;
        printf("%d ", x);
        x += k;
    }
    if(!hasRes)
        printf("-1");
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cctype>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;

int main()
{
    long long y, k, n, x;
    scanf("%I64d%I64d%I64d", &y, &k, &n);
    bool hasRes = false;
    if( y % k == 0 )
    {
        x = k;
    }
    else
    {
        x = (y / k + 1) * k - y;
    }
    while(y + x <= n)
    {
        hasRes = true;
        printf("%I64d ", x);
        x += k;
    }
    if(!hasRes)
        printf("-1");
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cctype>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;

int main()
{
    long long y, k, n, x;
    cin >> y >> k >> n;
    if( y % k == 0 )
    {
        x = k;
    }
    else
    {
        x = (y / k + 1) * k - y;
    }
    vector<long long> res;
    while(y + x <= n)
    {
        res.push_back(x);
        x += k;
    }
    if(res.size() == 0)
        cout << -1;
    else
        for(int i = 0; i < res.size(); i++)
            printf((i == res.size() - 1) ? "%d\n" : "%d ", res[i]);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cctype>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;

int main()
{
    long long y, k, n, x;
    cin >> y >> k >> n;
    if( y % k == 0 )
    {
        x = k;
    }
    else
    {
        x = (y / k + 1) * k - y;
    }
    vector<long long> res;
    while(y + x < n)
    {
        res.push_back(x);
        x += k;
    }
    if(res.size() == 0)
        cout << -1;
    else
        for(int i = 0; i < res.size(); i++)
            printf((i == res.size() - 1) ? "%d\n" : "%d ", res[i]);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cctype>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;

int main()
{
	int y, k, n, x;
	cin >> y >> k >> n;
	if( y % k == 0 )
	{
		x = k;
	}
	else
	{
		x = ((y / k) + 1) * k - y;
	}
	bool hasRes = false;
	vector<int> res;
	while(y + x < n)
	{
		hasRes = true;
		res.push_back(x);
		x += k;
	}
	if(!hasRes)
		cout << -1;
	else
		for(int i = 0; i < res.size(); i++)
			printf((i == res.size() - 1) ? "%d\n" : "%d ", res[i]);
	return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cctype>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;

int main()
{
    int y, k, n, x;
    cin >> y >> k >> n;
    if( y % k == 0 )
    {
        x = k;
    }
    else
    {
        x = (y / k + 1) * k - y;
    }
    vector<int> res;
    while(y + x < n)
    {
        res.push_back(x);
        x += k;
    }
    if(res.size() == 0)
        cout << -1;
    else
        for(int i = 0; i < res.size(); i++)
            printf((i == res.size() - 1) ? "%d\n" : "%d ", res[i]);
    return 0;
}


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

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> vI;
typedef vector<string> vS;
typedef pair<int, int> pI;
typedef map<int, int> mI;
typedef map<string, int> mSI;
typedef set<int> sI;
typedef set<pI> spI;
typedef priority_queue<int> qmax;
typedef priority_queue<int, vector<int>, greater<int> >qmin;
typedef map<int, int>::iterator mI_it;
typedef set<int>::iterator sI_it;

#define TWO(k)  (1<<(k))
#define LTWO(k) (((LL)(1)<<(k)))
#define MIN(a,b) ( (a)<(b)?(a):(b) )
#define MAX(a,b) ( (a)>(b)?(a):(b) )
#define LS(x) 	 ((x)<<1)
#define RS(x) 	 (((x)<<1)+1)
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define B begin()
#define E end()
#define F0(i, n) for( int (i) = 0; (i) < (n); (i)++)
#define F1(i, n) for( int (i) = 1; (i) <= (n); (i)++)
#define zero(i) memset((i),0,sizeof((i)))

const double PI = acos(-1.0);
const double EPS = 1e-9;
const int ioo = (~0)-(1<<31);
const LL loo = (~(LL)0)-((LL)1<<63);

int main()
{
    //freopen("in.txt","r",stdin);freopen("out.txt","w",stdout);
    int y,k,n;
    while( cin>>y>>k>>n)
    {
        int i;
        if( y % k == 0) i = y + 1;
        else i = ( y / k + 1) * k;
        bool flag = 0;
        while( 1)
        {
            if( i > n) break;
            if( i % k == 0) { flag = 1; cout<<i-y<<' '; }
            i += k;
        }
        if( flag) cout<<endl;
        else cout<<-1<<endl;
    }
    return(0);
}


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

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> vI;
typedef vector<string> vS;
typedef pair<int, int> pI;
typedef map<int, int> mI;
typedef map<string, int> mSI;
typedef set<int> sI;
typedef set<pI> spI;
typedef priority_queue<int> qmax;
typedef priority_queue<int, vector<int>, greater<int> >qmin;
typedef map<int, int>::iterator mI_it;
typedef set<int>::iterator sI_it;

#define TWO(k)  (1<<(k))
#define LTWO(k) (((LL)(1)<<(k)))
#define MIN(a,b) ( (a)<(b)?(a):(b) )
#define MAX(a,b) ( (a)>(b)?(a):(b) )
#define LS(x) 	 ((x)<<1)
#define RS(x) 	 (((x)<<1)+1)
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define B begin()
#define E end()
#define F0(i, n) for( int (i) = 0; (i) < (n); (i)++)
#define F1(i, n) for( int (i) = 1; (i) <= (n); (i)++)
#define zero(i) memset((i),0,sizeof((i)))

const double PI = acos(-1.0);
const double EPS = 1e-9;
const int ioo = (~0)-(1<<31);
const LL loo = (~(LL)0)-((LL)1<<63);

int main()
{
    //freopen("in.txt","r",stdin);freopen("out.txt","w",stdout);
    int y,k,n;
    while( cin>>y>>k>>n)
    {
        int i = y + 1; while( i % k != 0) i++;
        bool flag = 0;
        while( 1)
        {
            if( i > n) break;
            if( i % k == 0) { flag = 1; cout<<i-y<<' '; }
            i += k;
        }
        if( flag) cout<<endl;
        else cout<<-1<<endl;
    }
    return(0);
}


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

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> vI;
typedef vector<string> vS;
typedef pair<int, int> pI;
typedef map<int, int> mI;
typedef map<string, int> mSI;
typedef set<int> sI;
typedef set<pI> spI;
typedef priority_queue<int> qmax;
typedef priority_queue<int, vector<int>, greater<int> >qmin;
typedef map<int, int>::iterator mI_it;
typedef set<int>::iterator sI_it;

#define TWO(k)  (1<<(k))
#define LTWO(k) (((LL)(1)<<(k)))
#define MIN(a,b) ( (a)<(b)?(a):(b) )
#define MAX(a,b) ( (a)>(b)?(a):(b) )
#define LS(x) 	 ((x)<<1)
#define RS(x) 	 (((x)<<1)+1)
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define B begin()
#define E end()
#define F0(i, n) for( int (i) = 0; (i) < (n); (i)++)
#define F1(i, n) for( int (i) = 1; (i) <= (n); (i)++)
#define zero(i) memset((i),0,sizeof((i)))

const double PI = acos(-1.0);
const double EPS = 1e-9;
const int ioo = (~0)-(1<<31);
const LL loo = (~(LL)0)-((LL)1<<63);

int main()
{
    //freopen("in.txt","r",stdin);freopen("out.txt","w",stdout);
    int y,k,n;
    while( cin>>y>>k>>n)
    {
        int i;
        if( y % k == 0) i = y;
        else i = ( y / k + 1) * k;
        bool flag = 0;
        while( 1)
        {
            if( i > n) break;
            if( i % k == 0 && i > y) { flag = 1; cout<<i-y<<' '; }
            i += k;
        }
        if( flag) cout<<endl;
        else cout<<-1<<endl;
    }
    return(0);
}


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

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> vI;
typedef vector<string> vS;
typedef pair<int, int> pI;
typedef map<int, int> mI;
typedef map<string, int> mSI;
typedef set<int> sI;
typedef set<pI> spI;
typedef priority_queue<int> qmax;
typedef priority_queue<int, vector<int>, greater<int> >qmin;
typedef map<int, int>::iterator mI_it;
typedef set<int>::iterator sI_it;

#define TWO(k)  (1<<(k))
#define LTWO(k) (((LL)(1)<<(k)))
#define MIN(a,b) ( (a)<(b)?(a):(b) )
#define MAX(a,b) ( (a)>(b)?(a):(b) )
#define LS(x) 	 ((x)<<1)
#define RS(x) 	 (((x)<<1)+1)
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define B begin()
#define E end()
#define F0(i, n) for( int (i) = 0; (i) < (n); (i)++)
#define F1(i, n) for( int (i) = 1; (i) <= (n); (i)++)
#define zero(i) memset((i),0,sizeof((i)))

const double PI = acos(-1.0);
const double EPS = 1e-9;
const int ioo = (~0)-(1<<31);
const LL loo = (~(LL)0)-((LL)1<<63);

int main()
{
    //freopen("in.txt","r",stdin);freopen("out.txt","w",stdout);
    int y,k,n;
    while( cin>>y>>k>>n)
    {
        int i;
        if( y % k == 0) i = y;
        else i = ( y / k + 1) * k;
        bool flag = 0;
        while( 1)
        {
            if( i > n) break;
            if( i % k == 0) { flag = 1; if( i>y) cout<<i-y<<' '; }
            i += k;
        }
        if( flag) cout<<endl;
        else cout<<-1<<endl;
    }
    return(0);
}


#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <climits>
#include <cmath>

using namespace std;

int main()
{
    int n, k, y, c = 0;
    cin >> y >> k >> n;

    for(int s = y - (y % k) + k; s <= n; s += k)
    {
        printf("%d ",s-y);
        c++;
    }
    if(c == 0)cout << -1;
}


#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <climits>
#include <cmath>

using namespace std;

int main()
{
    int n, k, y, c = 0;
    cin >> y >> k >> n;

    for(int s = y - (y % k) + k; s < n; s += k)
    {
        printf("%d ",s-y);
        c++;
    }
    if(c == 0)cout << -1;
}


#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <climits>
#include <cmath>

using namespace std;

int main()
{

    int n, k, y, c = 0;
    cin >> y >> k >> n;

    for(int s = y - (y % k) + k; s <= n; s += k)
    {
        printf("%d ",s-y);
        c++;
    }
    if(c == 0)cout << -1;
}


#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <climits>
#include <cmath>

using namespace std;

int main()
{
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);

    int n, k, y, c = 0;
    cin >> y >> k >> n;

    for(int s = y - (y % k) + k; s <= n; s += k)
    {
        printf("%d ",s-y);
        c++;
    }
    if(c == 0)cout << -1;
}


#include <iostream>
using namespace std;
int main()
{
    int y,k,n,i,s=0;
    cin>>y>>k>>n;
    for (i=y+1;i<n+1;i++)
        if (i % k==0)
        {
            cout<<i<<" ";
            s++;
        }
    if (s==0)
        cout<<-1;
    cout<<endl;
    return 0;
}


#include <iostream>
using namespace std;
int main()
{
    int y,k,n,i,s=0;
    cin>>y>>k>>n;
    for (i=y;i<n;i++)
        if (i % k==0)
        {
            cout<<i<<endl;
            s++;
        }
        if (s==0)
            cout<<-1<<endl;
    return 0;
}


#include <iostream>
using namespace std;
void main()
{
    int i,y,k,n,u=0;
    cin>>y>>k>>n;
    if ((y/k+1)*k>=n)
        cout<<-1<<endl;
    else
    {
    for (i=(y/k+1)*k;i<=n+1;)
    {
        cout<<i-y<<" ";
        i=i+k;
    }
    cout<<endl;
    }
}


#include <iostream>
using namespace std;
void main()
{
	int i,y,k,n,u=0;
	cin>>y>>k>>n;
	if ((y/k+1)*k>n)
		cout<<-1<<endl;
	else
	{
	for (i=(y/k+1)*k;i<=n;i=i+k)
	{

		cout<<i-y<<" ";
	}
	cout<<endl;
	}
}


#include <iostream>
using namespace std;
void main()
{
	int i,y,k,n,u=0;
	cin>>y>>k>>n;
	if ((y/k+1)*k>=n)
		cout<<-1<<endl;
	else
	{
	for (i=(y/k+1)*k;i<=n;i=i+k)
	{

		cout<<i-y<<" ";
	}
	cout<<endl;
	}
}


#include <iostream>
using namespace std;
int main()
{
    int y,k,n,i,s=0;
    cin>>y>>k>>n;
    for (i=y;i<n;i++)
        if (i % k==0)
        {
            cout<<i<<" ";
            s++;
        }
    if (s==0)
        cout<<-1;
    cout<<endl;
    return 0;
}


#include <iostream>
using namespace std;
void main()
{
    int i,y,k,n,u=0;
    cin>>y>>k>>n;
    for(i=1;i<n-y+1;i++)
        if ((y+i)%k==0)
        {
            cout<<i<<" ";
            u++;
        }
    if (u==0)
        cout<<-1<<endl;
    else
        cout<<endl;
}


#include <iostream>
using namespace std;
void main()
{
    long int i,y,k,n,u=0;
    cin>>y>>k>>n;
    for(i=1;i<n-y+1;i++)
        if ((y+i)%k==0)
        {
            cout<<i<<" ";
            u++;
        }
    if (u==0)
        cout<<-1<<endl;
    else
        cout<<endl;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>

using namespace std;

int main() {
    //freopen("lis.in", "rt", stdin);
    //freopen("lis.out", "wt", stdout);

    int y, k, n;
    scanf("%d %d %d", &y, &k, &n);

    int cou = 0;
    for(int i = 1; i < 100100; i++) {
        if(i + y <= n && (i + n) % k == 0) {
            if(cou != 0) printf(" ");
            printf("%d", i);
            cou++;
        }
    }
    if(cou == 0) printf("-1");

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>

using namespace std;

int main() {
    int y, k, n;
    scanf("%d %d %d", &y, &k, &n);
    bool f = false;
    for(int i = y + (k - y % k); i <= n; i += k) {
        if(f) printf(" ");
        else f = true;
        printf("%d", i-y);
    }
    if(!f) printf("-1");
    return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>

using namespace std;

int main() {
    //freopen("lis.in", "rt", stdin);
    //freopen("lis.out", "wt", stdout);

    int y, k, n;
    scanf("%d %d %d", &y, &k, &n);

    int cou = 0;
    for(int i = 1; i < 1000000001; i++) {
        if(i + y <= n && (i + y) % k == 0) {
            if(cou != 0) printf(" ");
            printf("%d", i);
            i += (k - 1);
            cou++;
        }
    }
    if(cou == 0) printf("-1");

    return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>

using namespace std;

int main() {
    //freopen("lis.in", "rt", stdin);
    //freopen("lis.out", "wt", stdout);

    int y, k, n;
    scanf("%d %d %d", &y, &k, &n);

    int cou = 0;
    for(int i = 1; i < 1000000001; i++) {
        if(i + y <= n && (i + n) % k == 0) {
            if(cou != 0) printf(" ");
            printf("%d", i);
            i += (k - 1);
            cou++;
        }
    }
    if(cou == 0) printf("-1");

    return 0;
}


#include <iostream>
#include <time.h>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <set>
#include <ostream>

#define ll long long

using namespace std;
//http://codeforces.ru/problemset/problem/239/A
int main()
{
    ll y,k,n;
    cin>>y>>k>>n;
    int r = 0;
    for (int i = k ; i <= n; i+=k)
    {
        if (i- y >= 1) cout<< i-y<<' ';
        r++;
    }
    if (r != 0) cout<<"-1";
    //system("pause");
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
template<class T> ostream& operator<<(ostream &os, vector<T> V) {
os << "[ "; for(auto v : V) os << v << " "; return os << "]";}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {
    return os << "(" << P.first << "," << P.second << ")";}

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...) 1
#endif
typedef long long ll;
typedef double ld;
#define pll pair<ll,ll>
#define pii pair<int, int>
#define pb push_back
#define mp(x, y) make_pair((x), (y))
#define F first
#define S second
#define I insert
#define vi vector<int>
#define vll vector<ll>
#define vpll vector<pll>
#define vpii vector<pii>
#define all(x) (x).begin(), (x).end()
#define sz(x) (ll)(x).size()

const ll Mod = 1e9 + 7;
const int N  = 3e5 + 7;
int n , l , r , t;
vector<pair<int , pii> > v;
map<int, int> cord , rev;

int del[4*N], sum[4*N];

// del = -1 no changes;
// del = 0 means no elements are present
// del = 1 means all elements are present
// del = 2 means all elements are swapped

void lazy(int i , int j){
	if(del[i] != 2)
		del[j] = del[i];
	else{
		if(del[j] == 0)
			del[j] = 1;
		else if(del[j] == 1)
			del[j] = 0;
		else if(del[j] == -1)
			del[j] = 2;
		else
			del[j] = -1;
	}
}

int get(int i , int l , int r){

	if(del[i] == -1)
		return sum[i];
	else if(del[i] == 0)
		return 0;
	else if(del[i] == 1)
		return r-l+1;
	else
		return r-l+1-sum[i];

}

void push(int i , int l , int r){
	lazy(i , 2*i);
	lazy(i , 2*i+1);
	del[i] = -1;

}
void upt(int i, int l , int r){
	int mid = (l+r)>>1;
	sum[i] = get(2*i , l , mid) + get(2*i+1 , mid+1 , r);
}

int T[] = {0 , 1 , 0 , 2};

void update(int i , int l , int r , int L , int R , int t){
	// trace(i , l , r , L , R , t);
	if(r < L || l > R)
		return;
	if(l >= L && r <= R){
		if(del[i] == -1){
			del[i] = T[t];
		}
		else if(del[i] == 0){
			if(t == 1 || t == 3){
				del[i] = 1;
			}
		}
		else if(del[i] == 1){
			if(t == 2 || t == 3)
				del[i] = 0;
		}
		else{
			if(t == 1)
				del[i] = 1;
			else if(t == 2)
				del[i] = 0;
			else
				del[i] = -1;
		}

		return;
	}
	if(del[i] != -1)
		push(i , l , r);
	int mid = (l+r)>>1;
	update(2*i , l , mid , L , R , t);
	update(2*i+1 ,mid+1 , r , L , R , t);
	upt(i , l , r);
}
int query(int i , int l , int r){
	if(l == r)
		return l;
	// trace(i , del[i]);
	if(del[i] != -1){
		// trace(i , del[i]);
		if(l != r)
		push(i , l, r);

	}
	int mid = (l+r)>>1 , ans;
	// trace(i , l , r , get(2*i , l , mid));
	// trace(sum[i] , del[i] , del[2*i] , sum[2*i]);
	if(get(2*i , l , mid) == mid-l+1)
		ans = query(2*i+1 , mid+1 , r);
	else
		ans = query(2*i , l , mid);
	upt(i , l , r);
	return ans;
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	cin >> n;
	memset(del , -1 , sizeof(del));
	cord[1];
	for(int i = 0;i < n; i++){
		cin >> t >> l >> r;
		v.pb(mp(t , mp(l , r)));
		cord[l];
		cord[r+1];
		cord[r];
	}
	int id = 1;
	for(auto it : cord){
		rev[id] = it.F;
		cord[it.F] = id++;
	}
	for(auto it : v){
		// trace(cord[it.S.F] , cord[it.S.S]);
		update(1 , 1 , id-1 , cord[it.S.F], cord[it.S.S] , it.F);

		cout << rev[query(1 , 1 , id-1)] << '\n';
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
template<class T> ostream& operator<<(ostream &os, vector<T> V) {
os << "[ "; for(auto v : V) os << v << " "; return os << "]";}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {
    return os << "(" << P.first << "," << P.second << ")";}

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...) 1
#endif
typedef long long ll;
typedef double ld;
#define pll pair<ll,ll>
#define pii pair<int, int>
#define pb push_back
#define mp(x, y) make_pair((x), (y))
#define F first
#define S second
#define I insert
#define vi vector<int>
#define vll vector<ll>
#define vpll vector<pll>
#define vpii vector<pii>
#define all(x) (x).begin(), (x).end()
#define sz(x) (ll)(x).size()

const ll Mod = 1e9 + 7;
const int N  = 3e5 + 7;
int n , l , r , t;
vector<pair<int , pii> > v;
map<int, int> cord , rev;

int del[4*N], sum[4*N];

// del = -1 no changes;
// del = 0 means no elements are present
// del = 1 means all elements are present
// del = 2 means all elements are swapped

void lazy(int i , int j){
	if(del[i] != 2)
		del[j] = del[i];
	else{
		if(del[j] == 0)
			del[j] = 1;
		else if(del[j] == 1)
			del[j] = 0;
		else if(del[j] == -1)
			del[j] = 2;
		else
			del[j] = -1;
	}
}
int get(int i , int l , int r){

	if(del[i] == -1)
		return sum[i];
	else if(del[i] == 0)
		return 0;
	else if(del[i] == 1)
		return r-l+1;
	else
		return r-l+1-sum[i];
}
void push(int i , int l , int r){
	lazy(i , 2*i);
	lazy(i , 2*i+1);
	del[i] = -1;

}
void upt(int i, int l , int r){
	int mid = (l+r)>>1;
	sum[i] = get(2*i , l , mid) + get(2*i+1 , mid+1 , r);
}

void update(int i , int l , int r , int L , int R , int t){

	if(r < L || l > R)
		return;
	if(del[i] != -1 ){
		push(i , l , r);
	}
	if(l >= L && r <= R){
		// if(t == 3)
			// trace(i , l , r , L , R , sum[i]);
		if(t == 1)
			del[i] = 1;
		else if(t == 2)
			del[i] = 0;
		else{
			del[i] = 2;
		}

		return;
	}

	int mid = (l+r)>>1;
	update(2*i , l , mid , L , R , t);
	update(2*i+1 ,mid+1 , r , L , R , t);
	upt(i , l , r);
}
int query(int i , int l , int r){
	if(l == r)
		return l;
	// trace(i , del[i]);
	if(del[i] != -1){
		// trace(i , del[i]);
		push(i , l, r);
		upt(i , l , r);
	}
	int mid = (l+r)>>1 , ans;
	// trace(i , l , r , get(2*i , l , mid));
	// trace(sum[i] , del[i] , del[2*i] , sum[2*i]);
	if(get(2*i , l , mid) == mid-l+1)
		ans = query(2*i+1 , mid+1 , r);
	else
		ans = query(2*i , l , mid);

	return ans;
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n;
	memset(del , -1 , sizeof(del));
	cord[1];
	for(int i = 0;i < n; i++){
		cin >> t >> l >> r;
		v.pb(mp(t , mp(l , r)));
		cord[l];
		cord[r+1];
		cord[r];
	}
	int id = 1;
	for(auto it : cord){
		rev[id] = it.F;
		cord[it.F] = id++;
	}
	for(auto it : v){
		update(1 , 1 , id-1 , cord[it.S.F], cord[it.S.S] , it.F);

		cout << rev[query(1 , 1 , id-1)] << '\n';
	}

	return 0;
}


#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
std::mt19937 rng((int) std::chrono::steady_clock::now().time_since_epoch().count());
using namespace std;

#define int long long
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
ll mod = (1000000007LL);
inline ll Mod(ll a, ll b){return (a%b);}
inline ll poww(ll a, ll b){ll res = 1;while (b > 0){if(b & 1) res = (res * a)%mod;a = (a * a)%mod;b >>= 1;}return res;}
ll gcd (ll a, ll b) { while (b) { a %= b,swap(a, b);}return a;}
void read(vector<int> &w, int n){w.resize(n);for(int i = 0; i < n; i++) cin>>w[i];}
void print(vector<int> &w){for(int i =0; i < sz(w); i++){if(i == sz(w) - 1) cout<<w[i]<<"\n";else cout<<w[i]<<" ";}}
int prodmod(vector<int> w);
int summod(vector<int> w);
///CUIDADO COM MAXN
#define N 300050

int n, q, t[N],L[N], R[N], ini[N];
vector<int> val;
struct seg{
	#define l (2*nod)
	#define r (2*nod + 1)
	#define mid ((a+b)/2)
	int tree[4*N][2], lazy[4*N];
	void build(int nod, int a, int b){
		if(a==b){
			tree[nod][0]=1;
			tree[nod][1]=0;
			return;
		}
		build(l,a,mid),build(r,mid+1,b);
		tree[nod][0]=tree[l][0]+tree[r][0];
		tree[nod][1]=tree[l][1]+tree[r][1];
	}
	void f(int nod, int filho){
		if(lazy[nod] <= 2) lazy[filho] = lazy[nod];
		else{
			if(lazy[filho] == 0) lazy[filho]=3;
			else if(lazy[filho] <= 2) lazy[filho] = (lazy[filho] == 1?2:1);
			else lazy[filho] = 0;
		}
	}
	void prop(int nod, int a, int b){
		if(!lazy[nod]) return;
		if(lazy[nod] <= 2){ // set
			tree[nod][0] = 0;
			tree[nod][1] = 0;
			tree[nod][lazy[nod]%2]=(b-a+1);
		}
		else swap(tree[nod][0], tree[nod][1]);
		if(a != b){
			f(nod, l);
			f(nod, r);
		}
		lazy[nod]=0;
	}

 	void upd(int nod, int a, int b, int i, int j, int x){
 		prop(nod, a, b);
 		if(j < a or i > b) return;
 		if(i <= a and j >= b){
 			lazy[nod]=x;
 			prop(nod, a, b);
 			return;
 		}
 		upd(l,a,mid,i,j,x),upd(r,mid+1,b,i,j,x);
 		tree[nod][0]=tree[l][0]+tree[r][0];
 		tree[nod][1]=tree[l][1]+tree[r][1];
 	}
 	int query(int nod, int a, int b){
 		prop(nod, a, b);
 		if(tree[nod][0] == 0) return -1;
 		if(a==b)return a;
 		int A = query(l,a,mid);
 		if(A == -1) return query(r,mid+1, b);
 		else return A;
 	}
} S;
int32_t main(){
	ios::sync_with_stdio(false); cin.tie(0);
	cin>>q;
	val.pb(1);
	for(int i = 1; i <= q; i++){
		cin>>t[i]>>L[i]>>R[i];
		val.pb(L[i]);
		val.pb(R[i]);
		val.pb(R[i] + 1);
	}
	sort(all(val));
	val.erase(unique(all(val)), val.end());
	for(int i=1;i<=q;i++){
		int x = upper_bound(all(val), L[i]) - val.begin();
		int y = upper_bound(all(val), R[i]) - val.begin();
		int z = upper_bound(all(val), R[i]+1) - val.begin();
		ini[x]=L[i];
		ini[y]=R[i];
		ini[z]=R[i]+1;
		L[i]=x;
		R[i]=y;
	}
	S.build(1,1,N-1);
	for(int i = 1; i<=q;i++){
		// cout<<"QUERY "<<t[i]<<" "<<L[i]<<" "<<R[i]<<"\n";
		S.upd(1,1,N-1,L[i], R[i], t[i]);
		cout<<ini[S.query(1,1,N-1)]<<"\n";
	}
}
/*
    CUIDADO COM MAXN, MOD, OVERFLOW
    >Colocar (>DEFINE INT LONG LONG<) no inicio do template
    >mod = (1e9 + 7), por padrao (NAO ESQUECER DE ALTERAR)
    >NAO ESQUECER DEFINE INT LONG LONG
    > N = 1 ?
*/
int summod(vector<int> w){int curr=0;for(int i=0;i<sz(w); i++){curr = (curr+w[i])%mod;if(curr<0)curr+=mod;}return curr;}
int prodmod(vector<int> w){int curr = 1;
for(int i = 0; i < sz(w); i++){if(w[i] >= mod) w[i] %= mod;curr = (curr * w[i]) % mod;if(curr < 0) curr += mod;}return curr;}


#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
std::mt19937 rng((int) std::chrono::steady_clock::now().time_since_epoch().count());
using namespace std;

// #define int long long
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
ll mod = (1000000007LL);
inline ll Mod(ll a, ll b){return (a%b);}
inline ll poww(ll a, ll b){ll res = 1;while (b > 0){if(b & 1) res = (res * a)%mod;a = (a * a)%mod;b >>= 1;}return res;}
ll gcd (ll a, ll b) { while (b) { a %= b,swap(a, b);}return a;}
void read(vector<int> &w, int n){w.resize(n);for(int i = 0; i < n; i++) cin>>w[i];}
void print(vector<int> &w){for(int i =0; i < sz(w); i++){if(i == sz(w) - 1) cout<<w[i]<<"\n";else cout<<w[i]<<" ";}}
int prodmod(vector<int> w);
int summod(vector<int> w);
///CUIDADO COM MAXN
#define N 200050

int n, q, t[N],L[N], R[N], ini[N];
vector<int> val;
struct seg{
	#define l (2*nod)
	#define r (2*nod + 1)
	#define mid ((a+b)/2)
	int tree[4*N][2], lazy[4*N];
	void build(int nod, int a, int b){
		if(a==b){
			tree[nod][0]=1;
			tree[nod][1]=0;
			return;
		}
		build(l,a,mid),build(r,mid+1,b);
		tree[nod][0]=tree[l][0]+tree[r][0];
		tree[nod][1]=tree[l][1]+tree[r][1];
	}
	void f(int nod, int filho){
		if(lazy[nod] <= 2) lazy[filho] = lazy[nod];
		else{
			if(lazy[filho] == 0) lazy[filho]=3;
			else if(lazy[filho] <= 2) lazy[filho] = (lazy[filho] == 1?2:1);
			else lazy[filho] = 0;
		}
	}
	void prop(int nod, int a, int b){
		if(!lazy[nod]) return;
		if(lazy[nod] <= 2){ // set
			tree[nod][0] = 0;
			tree[nod][1] = 0;
			tree[nod][lazy[nod]%2]=(b-a+1);
		}
		else swap(tree[nod][0], tree[nod][1]);
		if(a != b){
			f(nod, l);
			f(nod, r);
		}
		lazy[nod]=0;
	}

 	void upd(int nod, int a, int b, int i, int j, int x){
 		prop(nod, a, b);
 		if(j < a or i > b) return;
 		if(i <= a and j >= b){
 			lazy[nod]=x;
 			prop(nod, a, b);
 			return;
 		}
 		upd(l,a,mid,i,j,x),upd(r,mid+1,b,i,j,x);
 		tree[nod][0]=tree[l][0]+tree[r][0];
 		tree[nod][1]=tree[l][1]+tree[r][1];
 	}
 	int query(int nod, int a, int b){
 		prop(nod, a, b);
 		if(tree[nod][0] == 0) return -1;
 		if(a==b)return a;
 		int A = query(l,a,mid);
 		if(A == -1) return query(r,mid+1, b);
 		else return A;
 	}
} S;
int32_t main(){
	// ios::sync_with_stdio(false); cin.tie(0);
	cin>>q;
	val.pb(1);
	for(int i = 1; i <= q; i++){
		cin>>t[i]>>L[i]>>R[i];
		val.pb(L[i]);
		val.pb(R[i]);
		val.pb(R[i] + 1);
	}
	sort(all(val));
	val.erase(unique(all(val)), val.end());
	for(int i=1;i<=q;i++){
		int x = upper_bound(all(val), L[i]) - val.begin();
		int y = upper_bound(all(val), R[i]) - val.begin();
		int z = upper_bound(all(val), R[i]+1) - val.begin();
		ini[x]=L[i];
		ini[y]=R[i];
		ini[z]=R[i]+1;
		L[i]=x;
		R[i]=y;
	}
	S.build(1,1,N-1);
	for(int i = 1; i<=q;i++){
		// cout<<"QUERY "<<t[i]<<" "<<L[i]<<" "<<R[i]<<"\n";
		S.upd(1,1,N-1,L[i], R[i], t[i]);
		cout<<ini[S.query(1,1,N-1)]<<"\n";
	}
}
/*
    CUIDADO COM MAXN, MOD, OVERFLOW
    >Colocar (>DEFINE INT LONG LONG<) no inicio do template
    >mod = (1e9 + 7), por padrao (NAO ESQUECER DE ALTERAR)
    >NAO ESQUECER DEFINE INT LONG LONG
    > N = 1 ?
*/
int summod(vector<int> w){int curr=0;for(int i=0;i<sz(w); i++){curr = (curr+w[i])%mod;if(curr<0)curr+=mod;}return curr;}
int prodmod(vector<int> w){int curr = 1;
for(int i = 0; i < sz(w); i++){if(w[i] >= mod) w[i] %= mod;curr = (curr * w[i]) % mod;if(curr < 0) curr += mod;}return curr;}


#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
std::mt19937 rng((int) std::chrono::steady_clock::now().time_since_epoch().count());
using namespace std;

#define int long long
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
ll mod = (1000000007LL);
inline ll Mod(ll a, ll b){return (a%b);}
inline ll poww(ll a, ll b){ll res = 1;while (b > 0){if(b & 1) res = (res * a)%mod;a = (a * a)%mod;b >>= 1;}return res;}
ll gcd (ll a, ll b) { while (b) { a %= b,swap(a, b);}return a;}
void read(vector<int> &w, int n){w.resize(n);for(int i = 0; i < n; i++) cin>>w[i];}
void print(vector<int> &w){for(int i =0; i < sz(w); i++){if(i == sz(w) - 1) cout<<w[i]<<"\n";else cout<<w[i]<<" ";}}
int prodmod(vector<int> w);
int summod(vector<int> w);
///CUIDADO COM MAXN
#define N 300050

int n, q, t[N],L[N], R[N], ini[N];
vector<int> val;
struct seg{
	#define l (2*nod)
	#define r (2*nod + 1)
	#define mid ((a+b)/2)
	int tree[4*N][2], lazy[4*N];
	void build(int nod, int a, int b){
		if(a==b){
			tree[nod][0]=1;
			tree[nod][1]=0;
			return;
		}
		build(l,a,mid),build(r,mid+1,b);
		tree[nod][0]=tree[l][0]+tree[r][0];
		tree[nod][1]=tree[l][1]+tree[r][1];
	}
	void f(int nod, int filho){
		if(lazy[nod] <= 2) lazy[filho] = lazy[nod];
		else{
			if(lazy[filho] == 0) lazy[filho]=3;
			else if(lazy[filho] <= 2) lazy[filho] = (lazy[filho] == 1?2:1);
			else lazy[filho] = 0;
		}
	}
	void prop(int nod, int a, int b){
		if(!lazy[nod]) return;
		if(lazy[nod] <= 2){ // set
			tree[nod][0] = 0;
			tree[nod][1] = 0;
			tree[nod][lazy[nod]%2]=(b-a+1);
		}
		else swap(tree[nod][0], tree[nod][1]);
		if(a != b){
			f(nod, l);
			f(nod, r);
		}
		lazy[nod]=0;
	}

 	void upd(int nod, int a, int b, int i, int j, int x){
 		prop(nod, a, b);
 		if(j < a or i > b) return;
 		if(i <= a and j >= b){
 			lazy[nod]=x;
 			prop(nod, a, b);
 			return;
 		}
 		upd(l,a,mid,i,j,x),upd(r,mid+1,b,i,j,x);
 		tree[nod][0]=tree[l][0]+tree[r][0];
 		tree[nod][1]=tree[l][1]+tree[r][1];
 	}
 	int query(int nod, int a, int b){
 		prop(nod, a, b);
 		if(tree[nod][0] == 0) return -1;
 		if(a==b)return a;
 		int A = query(l,a,mid);
 		if(A == -1) return query(r,mid+1, b);
 		else return A;
 	}
} S;
int32_t main(){
	ios::sync_with_stdio(false); cin.tie(0);
	cin>>q;
	val.pb(1);
	ini[1]=1;
	for(int i = 1; i <= q; i++){
		cin>>t[i]>>L[i]>>R[i];
		val.pb(L[i]);
		val.pb(R[i]);
		val.pb(R[i] + 1);
	}
	sort(all(val));
	val.erase(unique(all(val)), val.end());
	for(int i=1;i<=q;i++){
		int x = upper_bound(all(val), L[i]) - val.begin();
		int y = upper_bound(all(val), R[i]) - val.begin();
		int z = upper_bound(all(val), R[i]+1) - val.begin();
		ini[x]=L[i];
		ini[y]=R[i];
		ini[z]=R[i]+1;
		L[i]=x;
		R[i]=y;
	}
	S.build(1,1,N-1);
	for(int i = 1; i<=q;i++){
		// cout<<"QUERY "<<t[i]<<" "<<L[i]<<" "<<R[i]<<"\n";
		S.upd(1,1,N-1,L[i], R[i], t[i]);
		cout<<ini[S.query(1,1,N-1)]<<"\n";
	}
}
/*
    CUIDADO COM MAXN, MOD, OVERFLOW
    >Colocar (>DEFINE INT LONG LONG<) no inicio do template
    >mod = (1e9 + 7), por padrao (NAO ESQUECER DE ALTERAR)
    >NAO ESQUECER DEFINE INT LONG LONG
    > N = 1 ?
*/
int summod(vector<int> w){int curr=0;for(int i=0;i<sz(w); i++){curr = (curr+w[i])%mod;if(curr<0)curr+=mod;}return curr;}
int prodmod(vector<int> w){int curr = 1;
for(int i = 0; i < sz(w); i++){if(w[i] >= mod) w[i] %= mod;curr = (curr * w[i]) % mod;if(curr < 0) curr += mod;}return curr;}


#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
std::mt19937 rng((int) std::chrono::steady_clock::now().time_since_epoch().count());
using namespace std;

// #define int long long
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
ll mod = (1000000007LL);
inline ll Mod(ll a, ll b){return (a%b);}
inline ll poww(ll a, ll b){ll res = 1;while (b > 0){if(b & 1) res = (res * a)%mod;a = (a * a)%mod;b >>= 1;}return res;}
ll gcd (ll a, ll b) { while (b) { a %= b,swap(a, b);}return a;}
void read(vector<int> &w, int n){w.resize(n);for(int i = 0; i < n; i++) cin>>w[i];}
void print(vector<int> &w){for(int i =0; i < sz(w); i++){if(i == sz(w) - 1) cout<<w[i]<<"\n";else cout<<w[i]<<" ";}}
int prodmod(vector<int> w);
int summod(vector<int> w);
///CUIDADO COM MAXN
#define N 300050

int n, q, t[N],L[N], R[N], ini[N];
vector<int> val;
struct seg{
	#define l (2*nod)
	#define r (2*nod + 1)
	#define mid ((a+b)/2)
	int tree[4*N][2], lazy[4*N];
	void build(int nod, int a, int b){
		if(a==b){
			tree[nod][0]=1;
			tree[nod][1]=0;
			return;
		}
		build(l,a,mid),build(r,mid+1,b);
		tree[nod][0]=tree[l][0]+tree[r][0];
		tree[nod][1]=tree[l][1]+tree[r][1];
	}
	void f(int nod, int filho){
		if(lazy[nod] <= 2) lazy[filho] = lazy[nod];
		else{
			if(lazy[filho] == 0) lazy[filho]=3;
			else if(lazy[filho] <= 2) lazy[filho] = (lazy[filho] == 1?2:1);
			else lazy[filho] = 0;
		}
	}
	void prop(int nod, int a, int b){
		if(!lazy[nod]) return;
		if(lazy[nod] <= 2){ // set
			tree[nod][0] = 0;
			tree[nod][1] = 0;
			tree[nod][lazy[nod]%2]=(b-a+1);
		}
		else swap(tree[nod][0], tree[nod][1]);
		if(a != b){
			f(nod, l);
			f(nod, r);
		}
		lazy[nod]=0;
	}

 	void upd(int nod, int a, int b, int i, int j, int x){
 		prop(nod, a, b);
 		if(j < a or i > b) return;
 		if(i <= a and j >= b){
 			lazy[nod]=x;
 			prop(nod, a, b);
 			return;
 		}
 		upd(l,a,mid,i,j,x),upd(r,mid+1,b,i,j,x);
 		tree[nod][0]=tree[l][0]+tree[r][0];
 		tree[nod][1]=tree[l][1]+tree[r][1];
 	}
 	int query(int nod, int a, int b){
 		prop(nod, a, b);
 		if(tree[nod][0] == 0) return -1;
 		if(a==b)return a;
 		int A = query(l,a,mid);
 		if(A == -1) return query(r,mid+1, b);
 		else return A;
 	}
} S;
int32_t main(){
	ios::sync_with_stdio(false); cin.tie(0);
	cin>>q;
	val.pb(1);
	for(int i = 1; i <= q; i++){
		cin>>t[i]>>L[i]>>R[i];
		val.pb(L[i]);
		val.pb(R[i]);
		val.pb(R[i] + 1);
	}
	sort(all(val));
	val.erase(unique(all(val)), val.end());
	for(int i=1;i<=q;i++){
		int x = upper_bound(all(val), L[i]) - val.begin();
		int y = upper_bound(all(val), R[i]) - val.begin();
		int z = upper_bound(all(val), R[i]+1) - val.begin();
		ini[x]=L[i];
		ini[y]=R[i];
		ini[z]=R[i]+1;
		L[i]=x;
		R[i]=y;
	}
	S.build(1,1,N-1);
	for(int i = 1; i<=q;i++){
		// cout<<"QUERY "<<t[i]<<" "<<L[i]<<" "<<R[i]<<"\n";
		S.upd(1,1,N-1,L[i], R[i], t[i]);
		cout<<ini[S.query(1,1,N-1)]<<"\n";
	}
}
/*
    CUIDADO COM MAXN, MOD, OVERFLOW
    >Colocar (>DEFINE INT LONG LONG<) no inicio do template
    >mod = (1e9 + 7), por padrao (NAO ESQUECER DE ALTERAR)
    >NAO ESQUECER DEFINE INT LONG LONG
    > N = 1 ?
*/
int summod(vector<int> w){int curr=0;for(int i=0;i<sz(w); i++){curr = (curr+w[i])%mod;if(curr<0)curr+=mod;}return curr;}
int prodmod(vector<int> w){int curr = 1;
for(int i = 0; i < sz(w); i++){if(w[i] >= mod) w[i] %= mod;curr = (curr * w[i]) % mod;if(curr < 0) curr += mod;}return curr;}


/*input
3
1 1 3
3 2 5
3 1 7
*/
#include <bits/stdc++.h>
#define up(i,a,b) for(int (i) = (a);(i)<=(b);++(i))
#define down(i,b,a) for(int (i) = (b);i>=(a);--i)
#define bits(x,i) ((x >> i) & 1)
#define mid ((l+r)/2)
#define pr pair<int,int>
#define int long long
using namespace std;
const int N = 300005;
int seg[4 * N], lazy[4 * N];
struct query {
	long long l,r,t;
	query(){l = r = t = 0;}
	query(int _t,int _l,int _r) {t = _t; l = _l; r= _r;}
};
query a[N];
int q, n;
vector<long long> b;
#define pos(x) (upper_bound(b.begin(), b.end(), x) - b.begin())
void querryType(int u,int l,int r){
	if (!lazy[u]) return;
	if (lazy[u] == 1) { // turn the whole segment into 1.
		seg[u] = (r - l + 1);
	}
	else if (lazy[u] == 2){ // turn the whole segment into 0.
		seg[u] = 0;
	}
	else seg[u] = (r - l + 1) - seg[u];
}
void lazyFunction(int &u, int v){
	if (v == 3) {
		u = 3 - u;
		return;
	}
	u = v;
}
void lazy_upd(int u,int l,int r){
	if (!lazy[u]) return;
	querryType(u,l,r);
	if (l != r) {
		lazyFunction(lazy[u*2],lazy[u]);
		lazyFunction(lazy[u*2+1],lazy[u]);
	}
	lazy[u] = 0;
}
void upd(int u,int l,int r,int L,int R, int t){
	lazy_upd(u,l,r);
	if (l > r || l > R || r < L) return;
	if (L <= l && r <= R){
		lazy[u] = t;
		lazy_upd(u,l,r);
	}
	else {
		upd(u*2,l,mid,L,R,t);
		upd(u*2+1,mid+1,r,L,R,t);
		seg[u] = seg[u*2] + seg[u*2+1];
	}
}
int get(int u,int l,int r,int L,int R){
	if (l > r || l > R || r < L) return 0;
	lazy_upd(u,l,r);
	if (L <= l && r <= R) return seg[u];
	return get(u*2,l,mid,L,R) + get(u*2+1, mid+1, r, L, R);
}
int bSearch(){
	int u = 1, l = 1, r = n;
	lazy_upd(u,l,r);
	while (l != r){
		lazy_upd(u*2,l,mid);
		lazy_upd(u*2+1,mid+1,r);
		if (seg[u*2] != mid - l + 1) {
			u*=2;
			r = mid;
		}
		else {
			u = u*2 + 1;
			l = mid + 1;
		}
	}
	return l;
}
signed main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	cin >> q;
	b.push_back(1);
	up(i,1,q){
		int t,l,r; cin >> t >> l >> r;
		a[i] = query(t, l, r);
		b.push_back(l);
		b.push_back(r);
		b.push_back(r + 1);
	}
	// data compression
	sort(b.begin(), b.end());
	b.resize(unique(b.begin(), b.end()) - b.begin());
	// for(auto v : b) cout << v << ' '; cout << '\n';
	n = b.size();
	for(int i=1;i<=q;++i){
		int l = pos(a[i].l), r = pos(a[i].r), t = a[i].t;
		upd(1,1,n,l,r,t);
		// get(1,1,n,l,r);
		// for(int j=1;j<=n;++j) cout << get(1,1,n,j,j) << ' ';
		cout << b[bSearch() - 1] << '\n';
	}
}


/*input
3
1 1 3
3 2 5
3 1 7
*/
#include <bits/stdc++.h>
#define up(i,a,b) for(int (i) = (a);(i)<=(b);++(i))
#define down(i,b,a) for(int (i) = (b);i>=(a);--i)
#define bits(x,i) ((x >> i) & 1)
#define mid ((l+r)/2)
#define pr pair<int,int>
using namespace std;
const int N = 300005;
int seg[2 * N], lazy[2 * N];
struct query {
	int l,r,t;
	query(){l = r = t = 0;}
	query(int _t,int _l,int _r) {t = _t; l = _l; r= _r;}
};
query a[N];
int q, n;
vector<int> b;
#define pos(x) (upper_bound(b.begin(), b.end(), x) - b.begin())
void querryType(int u,int l,int r){
	if (!lazy[u]) return;
	if (lazy[u] == 1) { // turn the whole segment into 1.
		seg[u] = (r - l + 1);
	}
	else if (lazy[u] == 2){ // turn the whole segment into 0.
		seg[u] = 0;
	}
	else seg[u] = (r - l + 1) - seg[u];
}
void lazyFunction(int &u, int v){
	if (v == 3) {
		u = 3 - u;
		return;
	}
	u = v;
}
void lazy_upd(int u,int l,int r){
	if (!lazy[u]) return;
	querryType(u,l,r);
	if (l != r) {
		lazyFunction(lazy[u*2],lazy[u]);
		lazyFunction(lazy[u*2+1],lazy[u]);
	}
	lazy[u] = 0;
}
void upd(int u,int l,int r,int L,int R, int t){
	lazy_upd(u,l,r);
	if (l > r || l > R || r < L) return;
	if (L <= l && r <= R){
		lazy[u] = t;
		lazy_upd(u,l,r);
	}
	else {
		upd(u*2,l,mid,L,R,t);
		upd(u*2+1,mid+1,r,L,R,t);
		seg[u] = seg[u*2] + seg[u*2+1];
	}
}
int get(int u,int l,int r,int L,int R){
	if (l > r || l > R || r < L) return 0;
	lazy_upd(u,l,r);
	if (L <= l && r <= R) return seg[u];
	return get(u*2,l,mid,L,R) + get(u*2+1, mid+1, r, L, R);
}
int bSearch(){
	int u = 1, l = 1, r = n;
	lazy_upd(u,l,r);
	while (l != r){
		lazy_upd(u*2,l,mid);
		lazy_upd(u*2+1,mid+1,r);
		if (seg[u*2] != mid - l + 1) {
			u*=2;
			r = mid;
		}
		else {
			u = u*2 + 1;
			l = mid + 1;
		}
	}
	return l;
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	cin >> q;
	b.push_back(1);
	up(i,1,q){
		int t,l,r; cin >> t >> l >> r;
		a[i] = query(t, l, r);
		b.push_back(l);
		b.push_back(r);
		b.push_back(r + 1);
	}
	// data compression
	sort(b.begin(), b.end());
	b.resize(unique(b.begin(), b.end()) - b.begin());
	for(auto v : b) cout << v << ' '; cout << '\n';
	n = b.size();
	for(int i=1;i<=q;++i){
		int l = pos(a[i].l), r = pos(a[i].r), t = a[i].t;
		upd(1,1,n,l,r,t);
		// get(1,1,n,l,r);
		// for(int j=1;j<=n;++j) cout << get(1,1,n,j,j) << ' ';
		cout << b[bSearch() - 1] << '\n';
	}
}


/*input
3
1 1 3
3 2 5
3 1 7
*/
#include <bits/stdc++.h>
#define up(i,a,b) for(int (i) = (a);(i)<=(b);++(i))
#define down(i,b,a) for(int (i) = (b);i>=(a);--i)
#define bits(x,i) ((x >> i) & 1)
#define mid ((l+r)/2)
#define pr pair<int,int>
using namespace std;
const int N = 300005;
int seg[2 * N], lazy[2 * N];
struct query {
	int l,r,t;
	query(){l = r = t = 0;}
	query(int _t,int _l,int _r) {t = _t; l = _l; r= _r;}
};
query a[N];
int q, n;
vector<int> b;
#define pos(x) (upper_bound(b.begin(), b.end(), x) - b.begin())
void querryType(int u,int l,int r){
	if (!lazy[u]) return;
	if (lazy[u] == 1) { // turn the whole segment into 1.
		seg[u] = (r - l + 1);
	}
	else if (lazy[u] == 2){ // turn the whole segment into 0.
		seg[u] = 0;
	}
	else seg[u] = (r - l + 1) - seg[u];
}
void lazyFunction(int &u, int v){
	if (v == 3) {
		u = 3 - u;
		return;
	}
	u = v;
}
void lazy_upd(int u,int l,int r){
	if (!lazy[u]) return;
	querryType(u,l,r);
	if (l != r) {
		lazyFunction(lazy[u*2],lazy[u]);
		lazyFunction(lazy[u*2+1],lazy[u]);
	}
	lazy[u] = 0;
}
void upd(int u,int l,int r,int L,int R, int t){
	lazy_upd(u,l,r);
	if (l > r || l > R || r < L) return;
	if (L <= l && r <= R){
		lazy[u] = t;
		lazy_upd(u,l,r);
	}
	else {
		upd(u*2,l,mid,L,R,t);
		upd(u*2+1,mid+1,r,L,R,t);
		seg[u] = seg[u*2] + seg[u*2+1];
	}
}
int get(int u,int l,int r,int L,int R){
	if (l > r || l > R || r < L) return 0;
	lazy_upd(u,l,r);
	if (L <= l && r <= R) return seg[u];
	return get(u*2,l,mid,L,R) + get(u*2+1, mid+1, r, L, R);
}
int bSearch(){
	int u = 1, l = 1, r = n;
	lazy_upd(u,l,r);
	while (l != r){
		lazy_upd(u*2,l,mid);
		lazy_upd(u*2+1,mid+1,r);
		if (seg[u*2] != mid - l + 1) {
			u*=2;
			r = mid;
		}
		else {
			u = u*2 + 1;
			l = mid + 1;
		}
	}
	return l;
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	cin >> q;
	b.push_back(1);
	up(i,1,q){
		int t,l,r; cin >> t >> l >> r;
		a[i] = query(t, l, r);
		b.push_back(l);
		b.push_back(r);
		b.push_back(r + 1);
	}
	// data compression
	sort(b.begin(), b.end());
	b.resize(unique(b.begin(), b.end()) - b.begin());
	// for(auto v : b) cout << v << ' '; cout << '\n';
	n = b.size();
	for(int i=1;i<=q;++i){
		int l = pos(a[i].l), r = pos(a[i].r), t = a[i].t;
		upd(1,1,n,l,r,t);
		// get(1,1,n,l,r);
		// for(int j=1;j<=n;++j) cout << get(1,1,n,j,j) << ' ';
		cout << b[bSearch() - 1] << '\n';
	}
}


/*input
3
1 1 3
3 2 5
3 1 7
*/
#include <bits/stdc++.h>
#define up(i,a,b) for(int (i) = (a);(i)<=(b);++(i))
#define down(i,b,a) for(int (i) = (b);i>=(a);--i)
#define bits(x,i) ((x >> i) & 1)
#define mid ((l+r)/2)
#define pr pair<int,int>
#define int long long
using namespace std;
const int N = 300005;
int seg[2 * N], lazy[2 * N];
struct query {
	long long l,r,t;
	query(){l = r = t = 0;}
	query(int _t,int _l,int _r) {t = _t; l = _l; r= _r;}
};
query a[N];
int q, n;
vector<long long> b;
#define pos(x) (upper_bound(b.begin(), b.end(), x) - b.begin())
void querryType(int u,int l,int r){
	if (!lazy[u]) return;
	if (lazy[u] == 1) { // turn the whole segment into 1.
		seg[u] = (r - l + 1);
	}
	else if (lazy[u] == 2){ // turn the whole segment into 0.
		seg[u] = 0;
	}
	else seg[u] = (r - l + 1) - seg[u];
}
void lazyFunction(int &u, int v){
	if (v == 3) {
		u = 3 - u;
		return;
	}
	u = v;
}
void lazy_upd(int u,int l,int r){
	if (!lazy[u]) return;
	querryType(u,l,r);
	if (l != r) {
		lazyFunction(lazy[u*2],lazy[u]);
		lazyFunction(lazy[u*2+1],lazy[u]);
	}
	lazy[u] = 0;
}
void upd(int u,int l,int r,int L,int R, int t){
	lazy_upd(u,l,r);
	if (l > r || l > R || r < L) return;
	if (L <= l && r <= R){
		lazy[u] = t;
		lazy_upd(u,l,r);
	}
	else {
		upd(u*2,l,mid,L,R,t);
		upd(u*2+1,mid+1,r,L,R,t);
		seg[u] = seg[u*2] + seg[u*2+1];
	}
}
int get(int u,int l,int r,int L,int R){
	if (l > r || l > R || r < L) return 0;
	lazy_upd(u,l,r);
	if (L <= l && r <= R) return seg[u];
	return get(u*2,l,mid,L,R) + get(u*2+1, mid+1, r, L, R);
}
int bSearch(){
	int u = 1, l = 1, r = n;
	lazy_upd(u,l,r);
	while (l != r){
		lazy_upd(u*2,l,mid);
		lazy_upd(u*2+1,mid+1,r);
		if (seg[u*2] != mid - l + 1) {
			u*=2;
			r = mid;
		}
		else {
			u = u*2 + 1;
			l = mid + 1;
		}
	}
	return l;
}
signed main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	cin >> q;
	b.push_back(1);
	up(i,1,q){
		int t,l,r; cin >> t >> l >> r;
		a[i] = query(t, l, r);
		b.push_back(l);
		b.push_back(r);
		b.push_back(r + 1);
	}
	// data compression
	sort(b.begin(), b.end());
	b.resize(unique(b.begin(), b.end()) - b.begin());
	// for(auto v : b) cout << v << ' '; cout << '\n';
	n = b.size();
	for(int i=1;i<=q;++i){
		int l = pos(a[i].l), r = pos(a[i].r), t = a[i].t;
		upd(1,1,n,l,r,t);
		// get(1,1,n,l,r);
		// for(int j=1;j<=n;++j) cout << get(1,1,n,j,j) << ' ';
		cout << b[bSearch() - 1] << '\n';
	}
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstdlib>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <iomanip>

#define SWS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define ppb pop_back
#define ft first
#define sd second
#define read freopen("input.txt", "r", stdin)
#define write freopen("output.txt", "w", stdout)
#define files read; write

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

const int Z = (int)3e3 + 228;
const int N = (int)1e5 + 228;
const int INF = (int)1e9 + 228;
const int MOD = (int)1e9 + 7;

ll type[N], L[N], R[N], t_set[4 * N], t_xor[4 * N], t[4 * N];

void Add(int v, int tl, int tr, int x)
{
	t[v] = x * (tr - tl + 1);
	t_set[v] = x;
	t_xor[v] = 0;
}

void Xor(int v, int tl, int tr)
{
	t[v] = tr - tl + 1 - t[v];
	t_xor[v] ^= 1;
}

void push(int v, int tl, int tr)
{
	if (tl != tr)
		if (t_set[v] != -1)
		{
			t_set[v] ^= t_xor[v];
			int mid = (tl + tr) / 2;
			Add(2 * v, tl, mid, t_set[v]);
			Add(2 * v + 1, mid + 1, tr, t_set[v]);
		}
		else if (t_xor[v])
		{
			int mid = (tl + tr) / 2;
			Xor(2 * v, tl, mid);
			Xor(2 * v + 1, mid + 1, tr);
		}
	t_xor[v] = 0;
	t_set[v] = -1;
}

void update(int v, int tl, int tr, int l, int r, int x)
{
	push(v, tl, tr);
	if (tl >= l && tr <= r)
	{
		if (x != -1)
			Add(v, tl, tr, x);
		else
		{
			//cout << v << ' ' << t_xor[]
			Xor(v, tl, tr);
		}
		return;
	}
	if (tl > r || tr < l)
		return;
	int mid = (tl + tr) / 2;
	update(2 * v, tl, mid, l, r, x);
	update(2 * v + 1, mid + 1, tr, l, r, x);
	t[v] = t[2 * v] + t[2 * v + 1];
	//cout << v << ' ' << tl << ' ' << tr << ' ' << t[v] << ' ' << t_xor[v] << ' ' << t_set[v] << endl;
}

int get_ind(int v, int tl, int tr)
{
	push(v, tl, tr);
	if (tl == tr)
		return tl;
	int mid = (tl + tr) / 2;
	if (t[2 * v] != mid - tl + 1) return get_ind(2 * v, tl, mid);
	return get_ind(2 * v + 1, mid + 1, tr);
}

int main()
{
	SWS;
	//files;
	vector<ll> v;
	int q;
	cin >> q;
	for (int i = 1; i <= q; i++)
	{
		cin >> type[i] >> L[i] >> R[i];
		v.pb(L[i]);
		v.pb(R[i]);
		v.pb(R[i] + 1);
	}
	v.pb(1);
	sort(v.begin(), v.end());
	v.erase(unique(v.begin(), v.end()), v.end());
	int n = v.size();
	//for (int i = 0; i < n; i++)
	//	cout << v[i] << ' ';
	//cout << endl;
	for (int i = 1; i < 4 * N; i++)
		t_set[i] = -1;
	for (int i = 1; i <= q; i++)
	{
		int l = lower_bound(v.begin(), v.end(), L[i]) - v.begin() + 1;
		int r = lower_bound(v.begin(), v.end(), R[i]) - v.begin() + 1;
		//cout << "DEBUG" << endl;
		if (type[i] == 1)
			update(1, 1, n, l, r, 1);
		else if (type[i] == 2)
			update(1, 1, n, l, r, 0);
		else
			update(1, 1, n, l, r, -1);
		//if (l == 1 && r == 5) cout << t[1] << endl;
		int ind = get_ind(1, 1, n) - 1;
		//cout << t_xor[2] << endl;
		cout << v[ind] << endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstdlib>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <iomanip>

#define SWS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define ppb pop_back
#define ft first
#define sd second
#define read freopen("input.txt", "r", stdin)
#define write freopen("output.txt", "w", stdout)
#define files read; write

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

const int Z = (int)3e3 + 228;
const int N = (int)1e5 + 228;
const int INF = (int)1e9 + 228;
const int MOD = (int)1e9 + 7;

ll type[N], L[N], R[N], t_set[4 * N], t_xor[4 * N], t[4 * N];

void Add(int v, int tl, int tr, int x)
{
	t[v] = x * (tr - tl + 1);
	t_set[v] = x;
	t_xor[v] = 0;
}

void Xor(int v, int tl, int tr)
{
	t[v] = tr - tl + 1 - t[v];
	t_xor[v] ^= 1;
}

void push(int v, int tl, int tr)
{
	if (t_set[v] != -1)
	{
		t_set[v] ^= t_xor[v];
		int mid = (tl + tr) / 2;
		Add(2 * v, tl, mid, t_set[v]);
		Add(2 * v + 1, mid + 1, tr, t_set[v]);
	}
	else if (t_xor[v])
	{
		int mid = (tl + tr) / 2;
		Xor(2 * v, tl, mid);
		Xor(2 * v + 1, mid + 1, tr);
	}
	t_xor[v] = 0;
	t_set[v] = -1;
}

void update(int v, int tl, int tr, int l, int r, int x)
{
	push(v, tl, tr);
	if (tl >= l && tr <= r)
	{
		if (x != -1)
			Add(v, tl, tr, x);
		else
		{
			//cout << v << ' ' << t_xor[]
			Xor(v, tl, tr);
		}
		return;
	}
	if (tl > r || tr < l)
		return;
	int mid = (tl + tr) / 2;
	update(2 * v, tl, mid, l, r, x);
	update(2 * v + 1, mid + 1, tr, l, r, x);
	t[v] = t[2 * v] + t[2 * v + 1];
	//cout << v << ' ' << tl << ' ' << tr << ' ' << t[v] << ' ' << t_xor[v] << ' ' << t_set[v] << endl;
}

int get_ind(int v, int tl, int tr)
{
	push(v, tl, tr);
	if (tl == tr)
		return tl;
	int mid = (tl + tr) / 2;
	if (t[2 * v] != mid - tl + 1) return get_ind(2 * v, tl, mid);
	return get_ind(2 * v, mid + 1, tr);
}

int main()
{
	SWS;
	//files;
	vector<ll> v;
	int q;
	cin >> q;
	for (int i = 1; i <= q; i++)
	{
		cin >> type[i] >> L[i] >> R[i];
		v.pb(L[i]);
		v.pb(R[i]);
		v.pb(R[i] + 1);
	}
	v.pb(1);
	sort(v.begin(), v.end());
	v.erase(unique(v.begin(), v.end()), v.end());
	int n = v.size();
	for (int i = 0; i < n; i++)
		cout << v[i] << ' ';
	cout << endl;
	for (int i = 1; i <= 4 * n; i++)
		t_set[i] = -1;
	for (int i = 1; i <= q; i++)
	{
		int l = lower_bound(v.begin(), v.end(), L[i]) - v.begin() + 1;
		int r = lower_bound(v.begin(), v.end(), R[i]) - v.begin() + 1;
		//cout << "DEBUG" << endl;
		if (type[i] == 1)
			update(1, 1, n, l, r, 1);
		else if (type[i] == 0)
			update(1, 1, n, l, r, 0);
		else
			update(1, 1, n, l, r, -1);
		//if (l == 1 && r == 5) cout << t[1] << endl;
		int ind = get_ind(1, 1, n) - 1;
		//cout << t_xor[2] << endl;
		cout << v[ind] << endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstdlib>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <iomanip>

#define SWS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define ppb pop_back
#define ft first
#define sd second
#define read freopen("input.txt", "r", stdin)
#define write freopen("output.txt", "w", stdout)
#define files read; write

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

const int Z = (int)3e3 + 228;
const int N = (int)1e5 + 228;
const int INF = (int)1e9 + 228;
const int MOD = (int)1e9 + 7;

ll type[N], L[N], R[N], t_set[4 * N], t_xor[4 * N], t[4 * N];

void Add(int v, int tl, int tr, int x)
{
	t[v] = x * (tr - tl + 1);
	t_set[v] = x;
	t_xor[v] = 0;
}

void Xor(int v, int tl, int tr)
{
	t[v] = tr - tl + 1 - t[v];
	t_xor[v] ^= 1;
}

void push(int v, int tl, int tr)
{
	if (t_set[v] != -1)
	{
		t_set[v] ^= t_xor[v];
		int mid = (tl + tr) / 2;
		Add(2 * v, tl, mid, t_set[v]);
		Add(2 * v + 1, mid + 1, tr, t_set[v]);
	}
	else if (t_xor[v])
	{
		int mid = (tl + tr) / 2;
		Xor(2 * v, tl, mid);
		Xor(2 * v + 1, mid + 1, tr);
	}
	t_xor[v] = 0;
	t_set[v] = -1;
}

void update(int v, int tl, int tr, int l, int r, int x)
{
	push(v, tl, tr);
	if (tl >= l && tr <= r)
	{
		if (x != -1)
			Add(v, tl, tr, x);
		else
		{
			//cout << v << ' ' << t_xor[]
			Xor(v, tl, tr);
		}
		return;
	}
	if (tl > r || tr < l)
		return;
	int mid = (tl + tr) / 2;
	update(2 * v, tl, mid, l, r, x);
	update(2 * v + 1, mid + 1, tr, l, r, x);
	t[v] = t[2 * v] + t[2 * v + 1];
	//cout << v << ' ' << tl << ' ' << tr << ' ' << t[v] << ' ' << t_xor[v] << ' ' << t_set[v] << endl;
}

int get_ind(int v, int tl, int tr)
{
	push(v, tl, tr);
	if (tl == tr)
		return tl;
	int mid = (tl + tr) / 2;
	if (t[2 * v] != mid - tl + 1) return get_ind(2 * v, tl, mid);
	return get_ind(2 * v, mid + 1, tr);
}

int main()
{
	SWS;
	//files;
	vector<ll> v;
	int q;
	cin >> q;
	for (int i = 1; i <= q; i++)
	{
		cin >> type[i] >> L[i] >> R[i];
		v.pb(L[i]);
		v.pb(R[i]);
		v.pb(R[i] + 1);
	}
	v.pb(1);
	sort(v.begin(), v.end());
	v.erase(unique(v.begin(), v.end()), v.end());
	int n = v.size();
	for (int i = 0; i < n; i++)
		cout << v[i] << ' ';
	cout << endl;
	for (int i = 1; i <= 4 * n; i++)
		t_set[i] = -1;
	for (int i = 1; i <= q; i++)
	{
		int l = lower_bound(v.begin(), v.end(), L[i]) - v.begin() + 1;
		int r = lower_bound(v.begin(), v.end(), R[i]) - v.begin() + 1;
		//cout << "DEBUG" << endl;
		if (type[i] == 1)
			update(1, 1, n, l, r, 1);
		else if (type[i] == 0)
			update(1, 1, n, l, r, 0);
		else
			update(1, 1, n, l, r, -1);
		//if (l == 1 && r == 5) cout << t[1] << endl;
		//int ind = get_ind(1, 1, n) - 1;
		//cout << t_xor[2] << endl;
		cout << v[ind] << endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstdlib>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <iomanip>

#define SWS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define ppb pop_back
#define ft first
#define sd second
#define read freopen("input.txt", "r", stdin)
#define write freopen("output.txt", "w", stdout)
#define files read; write

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

const int Z = (int)3e3 + 228;
const int N = (int)1e5 + 228;
const int INF = (int)1e9 + 228;
const int MOD = (int)1e9 + 7;

ll type[N], L[N], R[N], t_set[4 * N], t_xor[4 * N], t[4 * N];

void Add(int v, int tl, int tr, int x)
{
	t[v] = x * (tr - tl + 1);
	t_set[v] = x;
	t_xor[v] = 0;
}

void Xor(int v, int tl, int tr)
{
	t[v] = tr - tl + 1 - t[v];
	t_xor[v] ^= 1;
}

void push(int v, int tl, int tr)
{
	if (t_set[v] != -1)
	{
		t_set[v] ^= t_xor[v];
		int mid = (tl + tr) / 2;
		Add(2 * v, tl, mid, t_set[v]);
		Add(2 * v + 1, mid + 1, tr, t_set[v]);
	}
	else if (t_xor[v])
	{
		int mid = (tl + tr) / 2;
		Xor(2 * v, tl, mid);
		Xor(2 * v + 1, mid + 1, tr);
	}
	t_xor[v] = 0;
	t_set[v] = -1;
}

void update(int v, int tl, int tr, int l, int r, int x)
{
	push(v, tl, tr);
	if (tl >= l && tr <= r)
	{
		if (x != -1)
			Add(v, tl, tr, x);
		else
		{
			//cout << v << ' ' << t_xor[]
			Xor(v, tl, tr);
		}
		return;
	}
	if (tl > r || tr < l)
		return;
	int mid = (tl + tr) / 2;
	update(2 * v, tl, mid, l, r, x);
	update(2 * v + 1, mid + 1, tr, l, r, x);
	t[v] = t[2 * v] + t[2 * v + 1];
	//cout << v << ' ' << tl << ' ' << tr << ' ' << t[v] << ' ' << t_xor[v] << ' ' << t_set[v] << endl;
}

int get_ind(int v, int tl, int tr)
{
	push(v, tl, tr);
	if (tl == tr)
		return tl;
	int mid = (tl + tr) / 2;
	if (t[2 * v] != mid - tl + 1) return get_ind(2 * v, tl, mid);
	return get_ind(2 * v, mid + 1, tr);
}

int main()
{
	SWS;
	//files;
	vector<ll> v;
	int q;
	cin >> q;
	for (int i = 1; i <= q; i++)
	{
		cin >> type[i] >> L[i] >> R[i];
		v.pb(L[i]);
		v.pb(R[i]);
		v.pb(R[i] + 1);
	}
	v.pb(1);
	sort(v.begin(), v.end());
	v.erase(unique(v.begin(), v.end()), v.end());
	int n = v.size();
	//for (int i = 0; i < n; i++)
	//	cout << v[i] << ' ';
	//cout << endl;
	for (int i = 1; i <= 4 * n; i++)
		t_set[i] = -1;
	for (int i = 1; i <= q; i++)
	{
		int l = lower_bound(v.begin(), v.end(), L[i]) - v.begin() + 1;
		int r = lower_bound(v.begin(), v.end(), R[i]) - v.begin() + 1;
		//cout << "DEBUG" << endl;
		if (type[i] == 1)
			update(1, 1, n, l, r, 1);
		else if (type[i] == 2)
			update(1, 1, n, l, r, 0);
		else
			update(1, 1, n, l, r, -1);
		//if (l == 1 && r == 5) cout << t[1] << endl;
		int ind = get_ind(1, 1, n) - 1;
		//cout << t_xor[2] << endl;
		cout << v[ind] << endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstdlib>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <iomanip>

#define SWS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define ppb pop_back
#define ft first
#define sd second
#define read freopen("input.txt", "r", stdin)
#define write freopen("output.txt", "w", stdout)
#define files read; write

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

const int Z = (int)3e3 + 228;
const int N = (int)1e5 + 228;
const int INF = (int)1e9 + 228;
const int MOD = (int)1e9 + 7;

ll type[N], L[N], R[N], t_set[4 * N], t_xor[4 * N], t[4 * N];

void Add(int v, int tl, int tr, int x)
{
	t[v] = x * (tr - tl + 1);
	t_set[v] = x;
	t_xor[v] = 0;
}

void Xor(int v, int tl, int tr)
{
	t[v] = tr - tl + 1 - t[v];
	t_xor[v] ^= 1;
}

void push(int v, int tl, int tr)
{
	if (t_set[v] != -1)
	{
		t_set[v] ^= t_xor[v];
		int mid = (tl + tr) / 2;
		Add(2 * v, tl, mid, t_set[v]);
		Add(2 * v + 1, mid + 1, tr, t_set[v]);
	}
	else if (t_xor[v])
	{
		int mid = (tl + tr) / 2;
		Xor(2 * v, tl, mid);
		Xor(2 * v + 1, mid + 1, tr);
	}
	t_xor[v] = 0;
	t_set[v] = -1;
}

void update(int v, int tl, int tr, int l, int r, int x)
{
	push(v, tl, tr);
	if (tl >= l && tr <= r)
	{
		if (x != -1)
			Add(v, tl, tr, x);
		else
		{
			//cout << v << ' ' << t_xor[]
			Xor(v, tl, tr);
		}
		return;
	}
	if (tl > r || tr < l)
		return;
	int mid = (tl + tr) / 2;
	update(2 * v, tl, mid, l, r, x);
	update(2 * v + 1, mid + 1, tr, l, r, x);
	t[v] = t[2 * v] + t[2 * v + 1];
	//cout << v << ' ' << tl << ' ' << tr << ' ' << t[v] << ' ' << t_xor[v] << ' ' << t_set[v] << endl;
}

int get_ind(int v, int tl, int tr)
{
	push(v, tl, tr);
	if (tl == tr)
		return tl;
	int mid = (tl + tr) / 2;
	if (t[2 * v] != mid - tl + 1) return get_ind(2 * v, tl, mid);
	return get_ind(2 * v, mid + 1, tr);
}

int main()
{
	SWS;
	//files;
	vector<ll> v;
	int q;
	cin >> q;
	for (int i = 1; i <= q; i++)
	{
		cin >> type[i] >> L[i] >> R[i];
		v.pb(L[i]);
		v.pb(R[i]);
		v.pb(R[i] + 1);
	}
	v.pb(1);
	sort(v.begin(), v.end());
	v.erase(unique(v.begin(), v.end()), v.end());
	int n = v.size();
	//for (int i = 0; i < n; i++)
	//	cout << v[i] << ' ';
	//cout << endl;
	for (int i = 1; i <= 4 * n; i++)
		t_set[i] = -1;
	for (int i = 1; i <= q; i++)
	{
		int l = lower_bound(v.begin(), v.end(), L[i]) - v.begin() + 1;
		int r = lower_bound(v.begin(), v.end(), R[i]) - v.begin() + 1;
		//cout << "DEBUG" << endl;
		if (type[i] == 1)
			update(1, 1, n, l, r, 1);
		else if (type[i] == 0)
			update(1, 1, n, l, r, 0);
		else
			update(1, 1, n, l, r, -1);
		//if (l == 1 && r == 5) cout << t[1] << endl;
		int ind = get_ind(1, 1, n) - 1;
		//cout << t_xor[2] << endl;
		cout << v[ind] << endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstdlib>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <iomanip>

#define SWS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define ppb pop_back
#define ft first
#define sd second
#define read freopen("input.txt", "r", stdin)
#define write freopen("output.txt", "w", stdout)
#define files read; write

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

const int Z = (int)3e3 + 228;
const int N = (int)1e5 + 228;
const int INF = (int)1e9 + 228;
const int MOD = (int)1e9 + 7;

ll type[N], L[N], R[N], t_set[8 * N], t_xor[8 * N], t[8 * N];

void Add(int v, int tl, int tr, int x)
{
	t[v] = x * (tr - tl + 1);
	t_set[v] = x;
	t_xor[v] = 0;
}

void Xor(int v, int tl, int tr)
{
	t[v] = tr - tl + 1 - t[v];
	t_xor[v] ^= 1;
}

void push(int v, int tl, int tr)
{
	if (tl == tr)
	{
		t_xor[v] = 0;
		t_set[v] = -1;
		return;
	}
	if (t_set[v] != -1)
	{
		t_set[v] ^= t_xor[v];
		int mid = (tl + tr) / 2;
		Add(2 * v, tl, mid, t_set[v]);
		Add(2 * v + 1, mid + 1, tr, t_set[v]);
	}
	else if (t_xor[v])
	{
		int mid = (tl + tr) / 2;
		Xor(2 * v, tl, mid);
		Xor(2 * v + 1, mid + 1, tr);
	}
	t_xor[v] = 0;
	t_set[v] = -1;
}

void update(int v, int tl, int tr, int l, int r, int x)
{
	push(v, tl, tr);
	if (tl >= l && tr <= r)
	{
		if (x != -1)
			Add(v, tl, tr, x);
		else
		{
			//cout << v << ' ' << t_xor[]
			Xor(v, tl, tr);
		}
		return;
	}
	if (tl > r || tr < l)
		return;
	int mid = (tl + tr) / 2;
	update(2 * v, tl, mid, l, r, x);
	update(2 * v + 1, mid + 1, tr, l, r, x);
	t[v] = t[2 * v] + t[2 * v + 1];
	//cout << v << ' ' << tl << ' ' << tr << ' ' << t[v] << ' ' << t_xor[v] << ' ' << t_set[v] << endl;
}

int get_ind(int v, int tl, int tr)
{
	push(v, tl, tr);
	if (tl == tr)
		return tl;
	int mid = (tl + tr) / 2;
	if (t[2 * v] != mid - tl + 1) return get_ind(2 * v, tl, mid);
	return get_ind(2 * v + 1, mid + 1, tr);
}

int main()
{
	SWS;
	//files;
	vector<ll> v;
	int q;
	cin >> q;
	for (int i = 1; i <= q; i++)
	{
		cin >> type[i] >> L[i] >> R[i];
		v.pb(L[i]);
		v.pb(R[i]);
		v.pb(R[i] + 1);
	}
	v.pb(1);
	sort(v.begin(), v.end());
	v.erase(unique(v.begin(), v.end()), v.end());
	int n = v.size();
	//for (int i = 0; i < n; i++)
	//	cout << v[i] << ' ';
	//cout << endl;
	for (int i = 1; i < 4 * N; i++)
		t_set[i] = -1;
	for (int i = 1; i <= q; i++)
	{
		int l = lower_bound(v.begin(), v.end(), L[i]) - v.begin() + 1;
		int r = lower_bound(v.begin(), v.end(), R[i]) - v.begin() + 1;
		//cout << "DEBUG" << endl;
		if (type[i] == 1)
			update(1, 1, n, l, r, 1);
		else if (type[i] == 2)
			update(1, 1, n, l, r, 0);
		else
			update(1, 1, n, l, r, -1);
		//if (l == 1 && r == 5) cout << t[1] << endl;
		int ind = get_ind(1, 1, n) - 1;
		//cout << t_xor[2] << endl;
		cout << v[ind] << endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstdlib>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <iomanip>

#define SWS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define ppb pop_back
#define ft first
#define sd second
#define read freopen("input.txt", "r", stdin)
#define write freopen("output.txt", "w", stdout)
#define files read; write

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

const int Z = (int)3e3 + 228;
const int N = (int)1e5 + 228;
const int INF = (int)1e9 + 228;
const int MOD = (int)1e9 + 7;

ll type[N], L[N], R[N], t_set[4 * N], t_xor[4 * N], t[4 * N];

void Add(int v, int tl, int tr, int x)
{
	t[v] = x * (tr - tl + 1);
	t_set[v] = x;
	t_xor[v] = 0;
}

void Xor(int v, int tl, int tr)
{
	t[v] = tr - tl + 1 - t[v];
	t_xor[v] ^= 1;
}

void push(int v, int tl, int tr)
{
	if (t_set[v] != -1)
	{
		t_set[v] ^= t_xor[v];
		int mid = (tl + tr) / 2;
		Add(2 * v, tl, mid, t_set[v]);
		Add(2 * v + 1, mid + 1, tr, t_set[v]);
	}
	else if (t_xor[v])
	{
		int mid = (tl + tr) / 2;
		Xor(2 * v, tl, mid);
		Xor(2 * v + 1, mid + 1, tr);
	}
	t_xor[v] = 0;
	t_set[v] = -1;
}

void update(int v, int tl, int tr, int l, int r, int x)
{
	push(v, tl, tr);
	if (tl >= l && tr <= r)
	{
		if (x != -1)
			Add(v, tl, tr, x);
		else
		{
			//cout << v << ' ' << t_xor[]
			Xor(v, tl, tr);
		}
		return;
	}
	if (tl > r || tr < l)
		return;
	int mid = (tl + tr) / 2;
	update(2 * v, tl, mid, l, r, x);
	update(2 * v + 1, mid + 1, tr, l, r, x);
	t[v] = t[2 * v] + t[2 * v + 1];
	//cout << v << ' ' << tl << ' ' << tr << ' ' << t[v] << ' ' << t_xor[v] << ' ' << t_set[v] << endl;
}

int get_ind(int v, int tl, int tr)
{
	push(v, tl, tr);
	if (tl == tr)
		return tl;
	int mid = (tl + tr) / 2;
	if (t[2 * v] != mid - tl + 1) return get_ind(2 * v, tl, mid);
	return get_ind(2 * v + 1, mid + 1, tr);
}

int main()
{
	SWS;
	//files;
	vector<ll> v;
	int q;
	cin >> q;
	for (int i = 1; i <= q; i++)
	{
		cin >> type[i] >> L[i] >> R[i];
		v.pb(L[i]);
		v.pb(R[i]);
		v.pb(R[i] + 1);
	}
	v.pb(1);
	sort(v.begin(), v.end());
	v.erase(unique(v.begin(), v.end()), v.end());
	int n = v.size();
	//for (int i = 0; i < n; i++)
	//	cout << v[i] << ' ';
	//cout << endl;
	for (int i = 1; i < 4 * N; i++)
		t_set[i] = -1;
	for (int i = 1; i <= q; i++)
	{
		int l = lower_bound(v.begin(), v.end(), L[i]) - v.begin() + 1;
		int r = lower_bound(v.begin(), v.end(), R[i]) - v.begin() + 1;
		//cout << "DEBUG" << endl;
		if (type[i] == 1)
			update(1, 1, n, l, r, 1);
		else if (type[i] == 2)
			update(1, 1, n, l, r, 0);
		else
			update(1, 1, n, l, r, -1);
		//if (l == 1 && r == 5) cout << t[1] << endl;
		int ind = get_ind(1, 1, n) - 1;
		//cout << t_xor[2] << endl;
		cout << v[ind] << endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstdlib>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <iomanip>

#define SWS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define ppb pop_back
#define ft first
#define sd second
#define read freopen("input.txt", "r", stdin)
#define write freopen("output.txt", "w", stdout)
#define files read; write

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

const int Z = (int)3e3 + 228;
const int N = (int)1e5 + 228;
const int INF = (int)1e9 + 228;
const int MOD = (int)1e9 + 7;

ll type[N], L[N], R[N], t_set[4 * N], t_xor[4 * N], t[4 * N];

void Add(int v, int tl, int tr, int x)
{
	t[v] = x * (tr - tl + 1);
	t_set[v] = x;
	t_xor[v] = 0;
}

void Xor(int v, int tl, int tr)
{
	t[v] = tr - tl + 1 - t[v];
	t_xor[v] ^= 1;
}

void push(int v, int tl, int tr)
{
	if (t_set[v] != -1)
	{
		t_set[v] ^= t_xor[v];
		int mid = (tl + tr) / 2;
		Add(2 * v, tl, mid, t_set[v]);
		Add(2 * v + 1, mid + 1, tr, t_set[v]);
	}
	else if (t_xor[v])
	{
		int mid = (tl + tr) / 2;
		Xor(2 * v, tl, mid);
		Xor(2 * v + 1, mid + 1, tr);
	}
	t_xor[v] = 0;
	t_set[v] = -1;
}

void update(int v, int tl, int tr, int l, int r, int x)
{
	push(v, tl, tr);
	if (tl >= l && tr <= r)
	{
		if (x != -1)
			Add(v, tl, tr, x);
		else
		{
			//cout << v << ' ' << t_xor[]
			Xor(v, tl, tr);
		}
		return;
	}
	if (tl > r || tr < l)
		return;
	int mid = (tl + tr) / 2;
	update(2 * v, tl, mid, l, r, x);
	update(2 * v + 1, mid + 1, tr, l, r, x);
	t[v] = t[2 * v] + t[2 * v + 1];
	//cout << v << ' ' << tl << ' ' << tr << ' ' << t[v] << ' ' << t_xor[v] << ' ' << t_set[v] << endl;
}

int get_ind(int v, int tl, int tr)
{
	push(v, tl, tr);
	if (tl == tr)
		return tl;
	int mid = (tl + tr) / 2;
	if (t[2 * v] != mid - tl + 1) return get_ind(2 * v, tl, mid);
	return get_ind(2 * v + 1, mid + 1, tr);
}

int main()
{
	SWS;
	//files;
	vector<ll> v;
	int q;
	cin >> q;
	for (int i = 1; i <= q; i++)
	{
		cin >> type[i] >> L[i] >> R[i];
		v.pb(L[i]);
		v.pb(R[i]);
		v.pb(R[i] + 1);
	}
	v.pb(1);
	sort(v.begin(), v.end());
	v.erase(unique(v.begin(), v.end()), v.end());
	int n = v.size();
	//for (int i = 0; i < n; i++)
	//	cout << v[i] << ' ';
	//cout << endl;
	for (int i = 1; i <= 4 * n; i++)
		t_set[i] = -1;
	for (int i = 1; i <= q; i++)
	{
		int l = lower_bound(v.begin(), v.end(), L[i]) - v.begin() + 1;
		int r = lower_bound(v.begin(), v.end(), R[i]) - v.begin() + 1;
		//cout << "DEBUG" << endl;
		if (type[i] == 1)
			update(1, 1, n, l, r, 1);
		else if (type[i] == 2)
			update(1, 1, n, l, r, 0);
		else
			update(1, 1, n, l, r, -1);
		//if (l == 1 && r == 5) cout << t[1] << endl;
		int ind = get_ind(1, 1, n) - 1;
		//cout << t_xor[2] << endl;
		cout << v[ind] << endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstdlib>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <iomanip>

#define SWS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define ppb pop_back
#define ft first
#define sd second
#define read freopen("input.txt", "r", stdin)
#define write freopen("output.txt", "w", stdout)
#define files read; write

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

const int Z = (int)3e3 + 228;
const int N = (int)6e5 + 228;
const int INF = (int)1e9 + 228;
const int MOD = (int)1e9 + 7;

ll type[N], L[N], R[N], t_set[4 * N], t_xor[4 * N], t[4 * N];

void Add(int v, int tl, int tr, int x)
{
	t[v] = x * (tr - tl + 1);
	t_set[v] = x;
	t_xor[v] = 0;
}

void Xor(int v, int tl, int tr)
{
	t[v] = tr - tl + 1 - t[v];
	t_xor[v] ^= 1;
}

void push(int v, int tl, int tr)
{
	if (tl == tr)
	{
		t_xor[v] = 0;
		t_set[v] = -1;
		return;
	}
	if (t_set[v] != -1)
	{
		t_set[v] ^= t_xor[v];
		int mid = (tl + tr) / 2;
		Add(2 * v, tl, mid, t_set[v]);
		Add(2 * v + 1, mid + 1, tr, t_set[v]);
	}
	else if (t_xor[v])
	{
		int mid = (tl + tr) / 2;
		Xor(2 * v, tl, mid);
		Xor(2 * v + 1, mid + 1, tr);
	}
	t_xor[v] = 0;
	t_set[v] = -1;
}

void update(int v, int tl, int tr, int l, int r, int x)
{
	push(v, tl, tr);
	if (tl >= l && tr <= r)
	{
		if (x != -1)
			Add(v, tl, tr, x);
		else
		{
			//cout << v << ' ' << t_xor[]
			Xor(v, tl, tr);
		}
		return;
	}
	if (tl > r || tr < l)
		return;
	int mid = (tl + tr) / 2;
	update(2 * v, tl, mid, l, r, x);
	update(2 * v + 1, mid + 1, tr, l, r, x);
	t[v] = t[2 * v] + t[2 * v + 1];
	//cout << v << ' ' << tl << ' ' << tr << ' ' << t[v] << ' ' << t_xor[v] << ' ' << t_set[v] << endl;
}

int get_ind(int v, int tl, int tr)
{
	push(v, tl, tr);
	if (tl == tr)
		return tl;
	int mid = (tl + tr) / 2;
	if (t[2 * v] != mid - tl + 1) return get_ind(2 * v, tl, mid);
	return get_ind(2 * v + 1, mid + 1, tr);
}

int main()
{
	SWS;
	//files;
	vector<ll> v;
	int q;
	cin >> q;
	for (int i = 1; i <= q; i++)
	{
		cin >> type[i] >> L[i] >> R[i];
		v.pb(L[i]);
		v.pb(R[i]);
		v.pb(R[i] + 1);
	}
	v.pb(1);
	sort(v.begin(), v.end());
	v.erase(unique(v.begin(), v.end()), v.end());
	int n = v.size();
	//for (int i = 0; i < n; i++)
	//	cout << v[i] << ' ';
	//cout << endl;
	for (int i = 1; i < 4 * N; i++)
		t_set[i] = -1;
	for (int i = 1; i <= q; i++)
	{
		int l = lower_bound(v.begin(), v.end(), L[i]) - v.begin() + 1;
		int r = lower_bound(v.begin(), v.end(), R[i]) - v.begin() + 1;
		//cout << "DEBUG" << endl;
		if (type[i] == 1)
			update(1, 1, n, l, r, 1);
		else if (type[i] == 2)
			update(1, 1, n, l, r, 0);
		else
			update(1, 1, n, l, r, -1);
		//if (l == 1 && r == 5) cout << t[1] << endl;
		int ind = get_ind(1, 1, n) - 1;
		//cout << t_xor[2] << endl;
		cout << v[ind] << endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstdlib>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <iomanip>

#define SWS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define ppb pop_back
#define ft first
#define sd second
#define read freopen("input.txt", "r", stdin)
#define write freopen("output.txt", "w", stdout)
#define files read; write

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

const int Z = (int)3e3 + 228;
const int N = (int)1e5 + 228;
const int INF = (int)1e9 + 228;
const int MOD = (int)1e9 + 7;

ll type[N], L[N], R[N], t_set[4 * N], t_xor[4 * N], t[4 * N];

void Add(int v, int tl, int tr, int x)
{
	t[v] = x * (tr - tl + 1);
	t_set[v] = x;
	t_xor[v] = 0;
}

void Xor(int v, int tl, int tr)
{
	t[v] = tr - tl + 1 - t[v];
	t_xor[v] ^= 1;
}

void push(int v, int tl, int tr)
{
	if (t_set[v] != -1)
	{
		t_set[v] ^= t_xor[v];
		int mid = (tl + tr) / 2;
		Add(2 * v, tl, mid, t_set[v]);
		Add(2 * v + 1, mid + 1, tr, t_set[v]);
	}
	else if (t_xor[v])
	{
		int mid = (tl + tr) / 2;
		Xor(2 * v, tl, mid);
		Xor(2 * v + 1, mid + 1, tr);
	}
	t_xor[v] = 0;
	t_set[v] = -1;
}

void update(int v, int tl, int tr, int l, int r, int x)
{
	push(v, tl, tr);
	if (tl >= l && tr <= r)
	{
		if (x != -1)
			Add(v, tl, tr, x);
		else
		{
			//cout << v << ' ' << t_xor[]
			Xor(v, tl, tr);
		}
		return;
	}
	if (tl > r || tr < l)
		return;
	int mid = (tl + tr) / 2;
	update(2 * v, tl, mid, l, r, x);
	update(2 * v + 1, mid + 1, tr, l, r, x);
	t[v] = t[2 * v] + t[2 * v + 1];
	//cout << v << ' ' << tl << ' ' << tr << ' ' << t[v] << ' ' << t_xor[v] << ' ' << t_set[v] << endl;
}

int get_ind(int v, int tl, int tr)
{
	push(v, tl, tr);
	if (tl == tr)
		return tl;
	int mid = (tl + tr) / 2;
	if (t[2 * v] != mid - tl + 1) return get_ind(2 * v, tl, mid);
	return get_ind(2 * v + 1, mid + 1, tr);
}

int main()
{
	SWS;
	//files;
	vector<ll> v;
	int q;
	cin >> q;
	for (int i = 1; i <= q; i++)
	{
		cin >> type[i] >> L[i] >> R[i];
		v.pb(L[i]);
		v.pb(R[i]);
		v.pb(R[i] + 1);
	}
	v.pb(1);
	sort(v.begin(), v.end());
	v.erase(unique(v.begin(), v.end()), v.end());
	int n = v.size();
	for (int i = 0; i < n; i++)
		cout << v[i] << ' ';
	cout << endl;
	for (int i = 1; i <= 4 * n; i++)
		t_set[i] = -1;
	for (int i = 1; i <= q; i++)
	{
		int l = lower_bound(v.begin(), v.end(), L[i]) - v.begin() + 1;
		int r = lower_bound(v.begin(), v.end(), R[i]) - v.begin() + 1;
		//cout << "DEBUG" << endl;
		if (type[i] == 1)
			update(1, 1, n, l, r, 1);
		else if (type[i] == 2)
			update(1, 1, n, l, r, 0);
		else
			update(1, 1, n, l, r, -1);
		//if (l == 1 && r == 5) cout << t[1] << endl;
		int ind = get_ind(1, 1, n) - 1;
		//cout << t_xor[2] << endl;
		cout << v[ind] << endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstdlib>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <iomanip>

#define SWS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define ppb pop_back
#define ft first
#define sd second
#define read freopen("input.txt", "r", stdin)
#define write freopen("output.txt", "w", stdout)
#define files read; write

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

const int Z = (int)3e3 + 228;
const int N = (int)1e5 + 228;
const int INF = (int)1e9 + 228;
const int MOD = (int)1e9 + 7;

ll type[N], L[N], R[N], t_set[8 * N], t_xor[8 * N], t[8 * N];

void Add(int v, int tl, int tr, int x)
{
	t[v] = x * (tr - tl + 1);
	t_set[v] = x;
	t_xor[v] = 0;
}

void Xor(int v, int tl, int tr)
{
	t[v] = tr - tl + 1 - t[v];
	t_xor[v] ^= 1;
}

void push(int v, int tl, int tr)
{
	if (tl != tr)
		if (t_set[v] != -1)
		{
			t_set[v] ^= t_xor[v];
			int mid = (tl + tr) / 2;
			Add(2 * v, tl, mid, t_set[v]);
			Add(2 * v + 1, mid + 1, tr, t_set[v]);
		}
		else if (t_xor[v])
		{
			int mid = (tl + tr) / 2;
			Xor(2 * v, tl, mid);
			Xor(2 * v + 1, mid + 1, tr);
		}
	t_xor[v] = 0;
	t_set[v] = -1;
}

void update(int v, int tl, int tr, int l, int r, int x)
{
	push(v, tl, tr);
	if (tl >= l && tr <= r)
	{
		if (x != -1)
			Add(v, tl, tr, x);
		else
		{
			//cout << v << ' ' << t_xor[]
			Xor(v, tl, tr);
		}
		return;
	}
	if (tl > r || tr < l)
		return;
	int mid = (tl + tr) / 2;
	update(2 * v, tl, mid, l, r, x);
	update(2 * v + 1, mid + 1, tr, l, r, x);
	t[v] = t[2 * v] + t[2 * v + 1];
	//cout << v << ' ' << tl << ' ' << tr << ' ' << t[v] << ' ' << t_xor[v] << ' ' << t_set[v] << endl;
}

int get_ind(int v, int tl, int tr)
{
	push(v, tl, tr);
	if (tl == tr)
		return tl;
	int mid = (tl + tr) / 2;
	if (t[2 * v] != mid - tl + 1) return get_ind(2 * v, tl, mid);
	return get_ind(2 * v + 1, mid + 1, tr);
}

int main()
{
	SWS;
	//files;
	vector<ll> v;
	int q;
	cin >> q;
	for (int i = 1; i <= q; i++)
	{
		cin >> type[i] >> L[i] >> R[i];
		v.pb(L[i]);
		v.pb(R[i]);
		v.pb(R[i] + 1);
	}
	v.pb(1);
	sort(v.begin(), v.end());
	v.erase(unique(v.begin(), v.end()), v.end());
	int n = v.size();
	//for (int i = 0; i < n; i++)
	//	cout << v[i] << ' ';
	//cout << endl;
	for (int i = 1; i < 4 * N; i++)
		t_set[i] = -1;
	for (int i = 1; i <= q; i++)
	{
		int l = lower_bound(v.begin(), v.end(), L[i]) - v.begin() + 1;
		int r = lower_bound(v.begin(), v.end(), R[i]) - v.begin() + 1;
		//cout << "DEBUG" << endl;
		if (type[i] == 1)
			update(1, 1, n, l, r, 1);
		else if (type[i] == 2)
			update(1, 1, n, l, r, 0);
		else
			update(1, 1, n, l, r, -1);
		//if (l == 1 && r == 5) cout << t[1] << endl;
		int ind = get_ind(1, 1, n) - 1;
		//cout << t_xor[2] << endl;
		cout << v[ind] << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

class Seg {
  int l, m, r;
  long long al, am, ar;
  Seg* ch[2] = {0};
  bool flip = false;
  int tag = -1;
  int sum = 0;
  void push() {
    if (flip) {
      for (int i : {0, 1}) {
        if (ch[i]->tag != -1) {
          ch[i]->tag = !ch[i]->tag;
          ch[i]->sum = ch[i]->tag * ch[i]->size();
        }
        else {
          ch[i]->flip ^= 1;
          ch[i]->sum = ch[i]->size() - ch[i]->sum;
        }
      }
      flip = false;
    }
    else if (tag != -1) {
      for (int i : {0, 1}) {
        ch[i]->tag = tag;
        ch[i]->flip = false;
        ch[i]->sum = ch[i]->size() * tag;
      }
      tag = -1;
    }
  }
  void pull() { sum = ch[0]->sum + ch[1]->sum; }
public:
  int size() { return r - l; }
  Seg(int l, int r, const vector<long long> &X) : l(l), r(r), m(l + r >> 1) {
    al = X[l], ar = X[r];
    if (r - l > 1) {
      am = X[m];
      ch[0] = new Seg(l, m, X);
      ch[1] = new Seg(m, r, X);
      pull();
    }
  }
  void apply(int ql, int qr, int v) {
    if (ql <= l and r <= qr) {
      tag = v, sum = v * size();
    }
    else {
      push();
      if (ql < m) ch[0]->apply(ql, qr, v);
      if (m < qr) ch[1]->apply(ql, qr, v);
      pull();
    }
  }
  void reverse(int ql, int qr) {
    if (ql <= l and r <= qr) {
      if (tag != -1) tag = !tag, sum = tag * size();
      else flip = !flip, sum = size() - sum;
    }
    else {
      push();
      if (ql < m) ch[0]->reverse(ql, qr);
      if (m < qr) ch[1]->reverse(ql, qr);
      pull();
    }
  }
  long long mex() {
    if (al == 0) cerr << l << ' ' << r << '\n';
    if (sum == 0) return al;
    push();
    return ch[ch[0]->size() == ch[0]->sum]->mex();
  }
};

int main() {
  ios_base::sync_with_stdio(false); cin.tie(0);
  int n; cin >> n;
  vector<tuple<int, long long, long long>> qs;
  vector<long long> X; map<long long, int> mp;
  set<long long> __ = {1ll, 1ll << 60};
  for (int i = 0; i < n; ++i) {
    int t, l, r; cin >> t >> l >> r;
    qs.emplace_back(t, l, r + 1);
    __.insert(l);
    __.insert(r + 1);
  }
  for (auto c : __) {
    int sz = mp.size();
    X.push_back(c);
    mp[c] = sz;
  }

  Seg root(0, X.size() - 1, X);

  for (int i = 0; i < n; ++i) {
    auto [t, l, r] = qs[i];
    if (t == 3) root.reverse(mp[l], mp[r]);
    else root.apply(mp[l], mp[r], 2 - t);
    cout << root.mex() << '\n';
  }
}