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

int main(void){
    list<int> l;
    list<int>::iterator it = l.end();

    int q;
    cin >> q;

    for(int i=0; i<q; i++){
        int query_num;
        cin >> query_num;
        if(query_num == 0){
            int x;
            cin >> x;
            it = l.insert(it,x);
        }
        else if(query_num == 1){
            int d;
            cin >> d;
            advance(it,d);
        }
        else if(query_num == 2){
            it = l.erase(it);
        }
    }

    for(it=l.begin(); it!=l.end(); it++){
        cout << *it << "\n";
    }
    return 0;
}
