#include<bits/stdc++.h>
#include<cstdio>
#include<iostream>
using namespace std;
string st;
int n,i,top;
int main()
{
cin>>st;
for(i=0;i<st.length();i++){
if(st[i]>='a'&&st[i]<='z'){
cout<<st[i];
}
if(st[i]=='+'||st[i]=='-'){
if(top==0){
st[top]=st[i];
top++;
}
else if(st[top-1]=='*'||st[top-1]=='/'){
while(st[top-1]!='+'||st[top-1]!='-'||st[top-1]!='('){
cout<<st[top-1];
top--;
}
}
else{
st[top]=st[i];
top++;
}
}
if(st[i]=='*'||st[i]=='/'){
if(top==0){
st[top]=st[i];
top++;
}
else{
st[top]=st[i];
top++;
}
}
if(st[i]=='('){
st[top]=st[i];
top++;
}
if(st[i]==')'){
while(st[top-1]!='('){
cout<<st[top-1];
top--;
}
top--;
}
}
for(i=top-1;i>=0;i--){
cout<<st[i];
}
return 0;
}