#include <iostream>
#include <list>
#define END 1000000001
using namespace std;

int main(){

	list<long int> a;
	list<long int>::iterator itr = a.end();
	int q;
	cin >> q;
	int querynum = 0;
	while (querynum < q) {
		int var1;
		cin >> var1;
		if (var1 == 0) {
			int var2;
			cin >> var2;
			itr = a.insert(itr, var2);
		}
		else if (var1 == 1) {
			int var2;
			cin >> var2;
			if (var2 > 0) for (int i = 0; i < var2; i++) ++itr; else for (int i = 0; i < -var2; i++) --itr;
		}
		else {
			itr = a.erase(itr);
		}
		querynum++;
	}

	itr = a.begin();
	while (itr != a.end()) cout << (*(itr++)) << endl;

	return 0;
}
