Description

Letters and antiletters can sometimes annihilate each other if they are too close. For example, the antiletter a- would annilate the letter a, which we write as a+ to avoid confusion. In fact, a- does not annihilate any other letters. Similarly, b- annihilates only b+ and so on. A letter and a corresponding antiletter will annihilate each other if they are next to each other.

Given a string of letters and antiletters, we would like to know what is left after all anihilations occur.

Input

Each line will consist of a string of letters and antiletters of length at most 5 * 105. Each letter or antiletter is a lower case characters followed by a symbol + or -. The input terminates with an empty line. There will be at most 30 lines in total.

Output

For each line, output the string after all anihilations have occured.

Sample Input

a+a-b+
a+b+c+c-b-a-
a+

Sample Output

b+

a+

Source

Northeast North-America 2009, practice contest