#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#include <list>
#define rep(i,n) for (int i = 0; (i) < (n); ++(i))
using namespace std;

int main() {
    list<int> a;
    list<int>::iterator c = a.end();
    int q;
    cin >> q;
    rep(i,q) {
        int t;
        cin >> t;
        switch(t) {
            case 0:
            int x;
            cin >> x;
            c = a.insert(c, x);
            break;
            case 1:
            int d;
            cin >> d;
            if (d > 0) rep(j,d)  c++;
            else       rep(j,-d) c--;
            break;
            case 2: 
            c = a.erase(c);
            break;
        }
    }
    for (list<int>::iterator itr = a.begin(); itr != a.end(); itr++)
        cout << *itr << endl;
    return 0;
}
