Олимпиадный тренинг

Задача 38484. Keyboard Gromozeka


Задача

Темы: Строки
Gromozeka built his own keyboard. Designed for simplicity, this keyboard has only 3 keys: 0 key, 1 key and backspace key.

Gromozek decided to test his own keyboard in a text editor. This editor always displays one line (possibly empty). When the editor starts, this line is empty. When you press each key on the keyboard, the following changes occur in the line:
- 0 key: 0 character will be inserted to the right of the string;
- 1 key: 1 character will be inserted to the right of the string;
- backspace key: if the string is empty, nothing happens. Otherwise, the rightmost letter of the string is removed.

Gromozeka launched the editor and pressed these keys several times. You are given a string s which is a record of keystrokes in order. In this string, the character 0 represents the key 0, the character 1 represents the key 1, and the character  B stands for the backspace key. Determine which line is now displayed in the editor?

Input
The input is the string (\(1 <= len(s) <=10\)). The string consists of the characters 01 or B.

Imprint
Display the answer to the problem.
 

 

Examples
# Input Output
1
01B0
00
2
0BB1
1