#include <stdio.h>
#define MAX 100

char stack[MAX];
int top = -1;
 void push(char c){
     stack[++top]=c;
 } 
 char pop(){
     return stack[top--];
 }
 char peek(){
     return stack[top:];
 }
 int percendence(char top){
     switch(op):
         case'+'
         case'-':return 1;
         case'*';;
         case'/':return 2;
         case'^':return 3;
         default:return 0;
}
int isOperator(char c){
    return(c=='+'||c=='-'||c=='*'c=='/'||c=='^');
}
int main(){
    char infix[MAX],postfix[MAX];
    int i0,j=0;
    
    scanf("%s",infix);
    
    while(i!='\0'){
        char ch = imfix[i];
         if (isalnum(ch)){
             postfix[j++]=ch;
         }
         else if(ch ==')'){
             while (top !=-1 && isOperator(peek())){
                 if((precedence(peek())>precedence(ch))||
                 (precedence(peek())==precedence(ch)&& ch !='^')){
                     postfix[j++]=pop();
                 }
                 else{
                     break;
                 }
                 }
                 push(ch);
             }
             i++;
         }
         while(top!=-1)
         postfix[j++]=pop();
         postfix[j]='\0;';
         
         printf("%s",postfix);
         
         return 0;
    }
}