Hide

Problem I
Lyklagangriti

Languages en is

Benni was browsing the web and accidentally got himself a keylogger. Luckily Benni has antivirus software that let him know about it, but the antivirus didn’t remove the virus itself. When Benni writes his passwords to log into various sites he tries to hide it so the keylogger won’t nab his passwords. Benni uses the arrow keys to move the cursor around and then erases letters to confuse the keylogger. Given the keys Benni used to write his password, can you find out what his password is?

Input

A single line containing a string of length $n$. Benni only writes lower case letters and digits, but when he presses the left arrow key, right arrow key or backspace it is denoted by L, R, B, in that order. Neither B nor L will appear in the string if the cursor is in front of the first letter and R won’t appear if the cursor is behind the last letter.

Output

One line containing Benni’s password.

Scoring

Group

Points

Constraints

1

10

$1 \leq n \leq 1000000$, no L, R or B appear in the string

2

13

$1 \leq n \leq 1000$

3

17

$1 \leq n \leq 1000000$, no L or R appear in the string

4

24

$1 \leq n \leq 1000000$, no B appear in the string

5

36

$1 \leq n \leq 1000000$

Sample Input 1 Sample Output 1
iLnLnLeLb
benni
Sample Input 2 Sample Output 2
arnarLLLBBun
unnar
Sample Input 3 Sample Output 3
password123
password123

Please log in to submit a solution to this problem

Log in