n = input()
result = []
res=''
for s in n:
if s.isalpha():
res += s
else:
if s == '(':
result.append(s)
elif s == '*' or s == '/':
while result and (result[-1] == '*' or result[-1] =='/'):
res += result.pop()
result.append(s)
elif s == '+' or s == '-':
while result and result[-1] != '(':
res+= result.pop()
result.append(s)
elif s == ')':
while result and result[-1] != '(':
res += result.pop()
result.pop()
while result:
res += result.pop()
print(res)