Honourable Job
Parsa, a Computer Science graduate, works as a typist. However, he has an unusual habit—whenever he makes a mistake while typing, instead of pressing the Backspace key, he mistakenly presses the = key.
You are given a string S, which represents what Parsa actually typed. Your task is to determine the string T, which represents what he intended to type. The rules for correction are as follows:
- A
=character erases the rightmost character before it appeared which is not a=(if any) - Leading
=characters do nothing (since there is nothing to erase)
Your goal is to reconstruct T from S and print it.
Input
In the only line of input you have the string S, which is what Parsa wrote with his keyboard.
It is guaranteed that S only contains small English letters and the character =.
Output
Print what Parsa intended to type.
Constraints
- 1≤∣S∣≤100000
Example 1
testtwoo===wo
testtwo
Comments0
No comments yet
Be the first to comment.
New comment
Log in to join the discussion.