stack = [] expression = list(sys.stdin.readline().rstrip()) res = '' for s in expression: if'A' <= s and s<='Z': res+=s else: if s =='(': stack.append(s) elif s =='*'or s=='/': while stack and (stack[-1] == '*'or stack[-1] =='/': res+=stack.pop() stack.append(s) elif s=='+'or s =='-': while stack and stack[-1] !='(': res+= stack.pop() stack.append(s) elif s == ')': while stack and stack[-1] != '(': res += satck.pop() stack.pop() while stack: res+=stack.pop() print(res)