#include <iostream>
#include <list>
using namespace std;

using ll = long long;

#define for_(i,a,b) for(int i = (a);i < (b);i++)
#define rfor_(i,a,b) for(int i = (b)-1;i >= (a);i--)
#define rep(i,n) for_(i,0,(n))
#define rrep(i,n) rfor_(i,0,(n))

using li = list<int>;

li a;

int main(){
	cin.tie(0);
	
	auto cur = a.end();
	
	int q;
	cin>>q;
	rep(i, q) {
		int c, x;
		cin>>c;
		if(c==0) {
			cin>>x;
			cur = a.insert(cur, x);
		}else if(c==1) {
			cin>>x;
			rep(i, (x<0?-x:x)) {
				if(x>0)cur++;
				else cur--;
			}
		}else {
			cur = a.erase(cur);
		}
	}
	
	 for(auto itr = a.begin(); itr != a.end(); itr++) {
	 	cout<<*itr<<endl;
    }

	return 0;
}

