#include <iostream>
#include <cstdio>
#include <cmath>
#include <cctype>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <list>
#include <algorithm>
#include <map>
#include <numeric>
#include <iomanip>

using namespace std;

/* typedef */

typedef long long ll;

/* constant */

const int INF = 1 << 30;
const int MAX = 100;
const int mod = 1000000007;
const double pi = 3.141592653589;
/* global variables */

/* function */

/* main */
int main() {

    list<int> L;
    int q; cin >> q;
    list<int>::iterator itr = L.end();
    while (q--) {

        int op; cin >> op;
        if (op == 2) {
            itr = L.erase(itr);
        }
        else {
            int x; cin >> x;
            if (op == 0) {
                itr = L.insert(itr, x);
                }
            else {
                if (x > 0)
                    while (x--) {
                        itr++;
                    }
                else 
                    while (x++) {
                        itr--;
                    }
            }
        }
    }
    for (auto l = L.begin(); l != L.end(); l++) 
        cout << *l << '\n';

}

