#include <iostream>

class Node {
public:
	long key;
	Node* next;
	Node* prev;
	Node(long k, Node* p, Node* n) {
		key = k;
		next = n;
		prev = p;
	}
};

int main() {
	int q;
	std::cin >> q;
	Node* start = new Node(0, nullptr, nullptr);
	Node* end = new Node(0, start, nullptr);
	start->next = end;
	Node* cur = end;
	int size = 0;
	while (q--) {
		int com;
		std::cin >> com;
		if (com == 0) {
			long x;
			std::cin >> x;
			Node* n = new Node(x, cur->prev, cur);
			cur->prev->next = n;
			cur->prev = n;
			cur = n;
			size++;
		}
		if (com == 1) {
			int d;
			std::cin >> d;
			if (d > 0) {
				for (int i = 0; i < d; i++) {
					cur = cur->next;
				}
			}
			else {
				for (int i = 0; i < std::abs(d); i++) {
					cur = cur->prev;
				}
			}
		}
		if (com == 2) {
			Node* tmp = cur;
			cur->prev->next = cur->next;
			cur->next->prev = cur->prev;
			cur = cur->next;
			delete[] tmp;
			size--;
		}
	}
	cur = start;
	for (int i = 0; i < size; i++) {
		cur = cur->next;
		std::cout << cur->key << std::endl;
	}
}
