Time limit
2s
Memory limit
128 MB
An infix expression places each operator between its two operands. A prefix expression places the operator before its operands, and a postfix expression places it after them. For example, X+Y is written as +XY in prefix notation and XY+ in postfix notation.
In postfix notation, precedence and parentheses are already reflected in the order of the symbols, so the expression can be processed from left to right. To convert an infix expression to postfix notation, determine the order of operations from parentheses and operator precedence, then move each operator after the two operands or subexpressions it combines.
Given an infix expression, write a program that prints the equivalent postfix expression.
The first line contains an infix expression.
Each operand is an uppercase English letter, and each operand appears exactly once. Expressions with unary operators or omitted multiplication are not given. The expression consists only of uppercase English letters, +, -, *, /, (, and ), and its length is at most 100.
Print the postfix expression equivalent to the given expression on one line.