import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;
import std.container : DList;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    Node node = null;

    int q = readint;
    for (int i = 0; i < q; i++) {
        auto qu = readints;
        switch (qu[0]) {
        case 0: // insert
            {
                auto x = new Node();
                x.value = qu[1];
                if (node !is null) {
                    auto prev = node.prev;
                    if (prev !is null) {
                        prev.next = x;
                        x.prev = prev;
                    }
                    if (node !is null) {
                        node.prev = x;
                        x.next = node;
                    }
                }
                node = x;
                break;
            }
        case 1: // move
            {
                writeln("move ", qu[1]);
                int d = qu[1];
                if (d >= 0) {
                    for (int j = 0; j < d; j++) {
                        node = node.next;
                    }
                }
                else {
                    for (int j = 0; j < -d; j++) {
                        node = node.prev;
                    }
                }
                break;
            }

        case 2: // erase
            {
                writeln("erase ", node);
                assert(node !is null);
                auto prev = node.prev;
                auto next = node.next;
                if (prev !is null) {
                    prev.next = next;
                }
                if (next !is null) {
                    next.prev = prev;
                }

                node = next;
                break;
            }

        default:
            break;
        }
    }

    auto x = node;
    while (x.prev !is null) x = x.prev;
    while (x !is null) {
        writeln(x.value);
        x = x.next;
    }
}

class Node {
    int value;
    Node next;
    Node prev;
}
