12350 - Typing   

Description

 

Nderman stole a special typing machine. Because he doesn't like anybody look at him, he can only type to express himself. There're several function that this typing machine has.


(This problem is partial judge!)

 

void insert(Node**, char);

append one more character char after the cursor. Note that the cursor doesn't move after the appending.

void deletion(Node**);

delete one character after the cursor. If you reach the end of the typing, delete nothing.

void backspace(Node**);

delete one character before the cursor. If you reach the beginning of the typing, delete nothing.

void go_left(Node**, int);

move the cursor to the left for int times. If you reach the beginning of the typing you should go to the end of typing and continue the moves of your cursor.

void go_right(Node**, int);

move the cursor to the right for int times. If you reach the end of the typing you should go to the beginning of typing and continue the moves of your cursor.

void go_home(Node**);

move the cursor to the beginning of the typing.

void go_end(Node**);

move the cursor to the end of the typing

void show();

show all the typing.

Finish all the function except "show()"(we have done it for you).

(the picture Nderman stealing the typing machine)

Input

input contains several lines

First line will contain one integer n.

testcase 1 & 2:​1  <= n <= 100

testcase 3 & 4:500 <= n <= 2000

Following n lines, each line contains one of the functions.

 

Output

If the function is show you should print all the tpying.

Sample Input  Download

Sample Output  Download

Partial Judge Code

12350.c

Partial Judge Header

12350.h

Tags




Discuss