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

struct node{
  int val;
  node* prv;
  node* nxt;
  node():prv(nullptr),nxt(nullptr){}
  node(int v):val(v),prv(nullptr),nxt(nullptr){}
};
struct mylist{
  node* head;
  node* tail;
  node* cur;
  mylist(){
    head = new node;
    tail = new node;
    head->nxt = tail;
    tail->prv = head;
    cur = tail;
  }
  void insert(int v){
    node* add = new node(v);
    cur->prv->nxt = add;
    add->prv = cur->prv;
    add->nxt = cur;
    cur->prv = add;
    cur = add;
  }
  void dump(){
    node* tmp = head->nxt;
    while(tmp->nxt!=nullptr){
      cout<< tmp->val <<endl;
      tmp = tmp->nxt;
    }
  }
  void move(int d){
    while(d){
      if(d<0){
        cur = cur->prv;
        d++;
      }else{
        cur = cur->nxt;
        d--;
      }
    }
  }
  void erase(){
    cur->prv->nxt = cur->nxt;
    cur->nxt->prv = cur->prv;
    cur = cur->nxt;
  }
};

signed main(){

  mylist lis;
  int q;cin>>q;
  while(q--){
    int com;cin>>com;
    if(com==0){
      int x;cin>>x;
      lis.insert(x);
    }
    else if(com==1){
      int d;cin>>d;
      lis.move(d);
    }
    else{
      lis.erase();
    }
  }
  lis.dump();

}
