#include <iostream>
#include <cstdlib>
#include <list>
using namespace std;
int main()
{
    list<int> a;
    auto itr = a.end();
    int q, query, tmp;
    cin >> q;
    for (int i=0; i<q; ++i){
        cin >> query;
        switch(query){
            case 0:
                cin >> tmp;
                itr = a.insert(itr, tmp);
                break;
            case 1:
                cin >> tmp;
                while(tmp!=0){
                    if(tmp > 0){
                        itr++;
                        tmp--;
                    }
                    else if (tmp < 0){
                        itr--;
                        tmp++;
                    }
                }
                break;
            case 2:
                itr = a.erase(itr);
                break;
        }
    }
    for (auto j=a.begin(); j != a.end(); ++j){
        cout << *j << endl;
    }
}
