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

int main()
{
   // freopen("C:\\Users\\parth\\Desktop\\input.txt","r",stdin);
   // freopen("C:\\Users\\parth\\Desktop\\output.txt","w",stdout);

    list<int> ls;
    list<int>::iterator ite,it  = ls.begin();
    ite = it;
    int test;
    cin>>test;
    while(test--)
    {
         ite = it;
        int command,value;
        cin>>command;
        switch(command)
        {
        case 0:
            cin>>value;
            ls.insert(it,value);
            it--;
            break;
        case 1:
            cin>>value;
            if(value>=0){ 
                for(int i = 0;i<value;i++)
                        it++;

            }
            else{ 
                for(int i = 0;i<abs(value);i++)
                it--;
            }
            break;
        case 2:
        
        if(!(ls.empty())) it = ls.erase(it);
            break;
        }
    }
    for(it = ls.begin();it != ls.end();it++) cout<<*it<<endl;




    return 0;
}

