Honourable Job

View as PDF

Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

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 \le |S| \le 100 000

Example 1

Input
testtwoo===wo
Output
testtwo

Comments

There are no comments at the moment.