Programmers use version control systems to manage files in their projects, but in these systems, versions are saved only when you manually submit. Can you implement an IDE that automatically saves a new version whenever you insert or delete a string?
Positions in the buffer are numbered from 1 from left to right. Initially, the buffer is empty and in version 0. Then you can execute 3 commands (vnow means the version before executing the command, and L[v] means the length of buffer at version v):
1 p s: insert string s after position p (0<=p<=L[vnow], p = 0 means insert before the start of the start of the buffer). s contains at most 1 and at most 100 letters.
2 p c: remove c characters starting at position p (p>=1; p + c<=L[vnow] + 1). The remaining characters (if any) will be shifted left, filling the blank.
3 v p c: print c characters starting at position p (p>=1; p + c<=L[v] + 1), in version v (1<=v<=vnow).
The first command is guaranteed to be command 1(insert). After executing each command 1 or 2, version is incremented by 1.