10501 - Midterm Practice Crazy Monkey   

Description

There is a monkey in a zoo. One day, the animal trainer gives the monkey a typewriter. The monkey starts to press the buttons randomly.

The typewriter contains the following buttons.

  • Ÿ   English alphabet (i.e., A-Z, and a-z)
  • Ÿ   Numbers (i.e., 0-9)
  • Ÿ   Special characters

1.          '@' means the 'Home' key:

 Return the cursor to the beginning of the sentence.

2.         '#' means the 'End' key:

Put the cursor at the end of the sentence.

3.         '%' means the 'Delete' key:

Delete one character to the right of the cursor.

 

HINT:

Input

There is one line that contains at least one and at most 100,000 characters which represent what the monkey types.

Output

Print out the result that will be displayed on the screen for the monkey’s typing. Your program should print the answer followed by a new line character.

Sample Input  Download

Sample Output  Download

Tags




Discuss