#include <cstdio>
#include <list>
using namespace std;
 
int main() {
  int num_query; scanf("%d", &num_query);
  list<int> nums;
  list<int>::iterator it = nums.end();
   
  while (num_query--) {
    int command; scanf("%d", &command);
     
    switch (command) {
      case 0:
        int x; scanf("%d", &x);
        it = nums.insert(it, x);
        break;
      case 1:
        int d; scanf("%d", &d);
        if (d > 0) while(d--) it++;
        else while(d++) it--;
        break;
      case 2:
        it = nums.erase(it);
        break;
    }
  }
  
  for (it = nums.begin(); it != nums.end(); it++) printf("%d\n", *it);
}
