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

#define rep(i,s,n) for(ll i = (s); i < (n); i++)
#define rep0(i,n) rep(i,0,n)
#define rep1(i,n) rep(i,1,n+1)

#define BR "\n"

int main() {
  int q;
  cin >> q;

  list<int> l;
  auto itr = l.end();

  rep0(i, q) {
    int query; cin >> query;
    if (query == 0) {
      int x; cin >> x;
      itr = l.insert(itr, x);

    } else if (query == 1) {
      int d; cin >> d;
      if (d > 0) rep0(i, d) itr++;
      else rep0(i, -d) itr--;

    } else {
      itr = l.erase(itr);
    }
  }

  for(auto itr2 = l.begin(); itr2 != l.end(); itr2++) {
    cout << *itr2 << BR;
  }

  return 0;
}
