#include <iostream>
#include <list>
using namespace std;
typedef long long ll;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
#define all(v) v.begin(), v.end()
#define repi(i, n, init) for (ll i = init; i < (n); i++)
#define repd(i, n, init) for (ll i = (n); i >= init; i--)
#define repm(i, m) for (auto i = m.begin(); i != m.end(); i++)
#define repb(bit, n, init) for (ll bit = init; bit < (1 << n); ++bit)

int main()
{
    list<int> A;
    int n;
    auto it = A.end();
    cin >> n;
    repi(i, n, 0)
    {
        int op, x, d;
        cin >> op;
        if (op == 0)
        {
            cin >> x;
            A.insert(it,x);
            it--;
        }
        else if (op == 1)
        {
            cin >> d;
            advance(it,d);
        }
        else if (op == 2)
        {
            it = A.erase(it);
        }
    }
    repm(i,A){
        cout << *i << endl;
    }
    return 0;
}
