#include<cstdio>
#include<queue>
#include<iostream>
#include<algorithm>
#include<list>
#include<vector>
using namespace std;
list<int>mylist;
list<int>::iterator i = mylist.end();
int main() {
	int t,b,c;
	cin >> t;
	while (t--)
	{
		int choose;
		cin >> choose;
		switch (choose)
		{
		case 0:
			cin >> b;
			i=mylist.insert(i,b);
			break;
		case 1:
			cin >> b;
			if (b > 0)
			{
				for (int k = 0; k < b; k++)
				{
					i++;
				}
			}
			if (b < 0)
			{
				for (int k = 0; k < -b; k++)
				{
					i--;
				}
			}
			break;
		case 2:
			i=mylist.erase(i);
		}
	}
	for (i = mylist.begin(); i != mylist.end(); i++)
	{
		cout << *i << endl;
	}
}


