#include <cstdio>
#include <list>
#include <algorithm>
using namespace std;

int main() {
	list<int> L;
    list<int>::iterator cur = L.end();
	int num_query; scanf("%d", &num_query);
	int command, tmp;
	for (int loop = 0; loop < num_query; loop++) {
		scanf("%d", &command);
		switch (command) {
		case 0:
			scanf("%d", &tmp);
            cur = L.insert(cur, tmp);
			break;
		case 1:
			scanf("%d", &tmp);
            if (tmp > 0) {
				for (int i = 0; i < +tmp; i++) cur++;
			} else {
				for (int i = 0; i < -tmp; i++) cur--;
			}
			break;
		case 2:
            cur = L.erase(cur);
			break;
    	}
	}
    for (int x: L) printf("%d\n", x);
	return 0;
}

