# include <stdio.h>
# include <ctype.h>
# include <string.h>

# define MAX 100
int precedence(char op){
    if(op == '^')return 3;
    if(op =='*' || op == '/') return 2;
    if(op =='+' || op =='-') return 1;
    return 0;
    
}
int isleftassociative (char op){
    return (op!='^');
    
}
void infixtopostfix(char *infix){
    char stack[MAX];
    int top =-1;
    char postfix[MAX];
    int k=0;
    

for(int i=0; infix[i]!='\0';i++){
    char ch =infix[i];
    if (isalnum(ch)){
        postfix[k++]=ch;
    }
    else if (ch==')'){
        stack[++top]=ch;
    }
    else if (ch ==')'){
        while(top!=-1 && stack[top]!='('){
            postfix [k++]=stack[top--];
        }
        if (top!=-1 && stack[top])
        top --;
    }
    else{
        while(top!=-1 && precedence(stack[top]) >precedence(ch)||(top !=-1 && precedence (stack[top] == precedence(ch)&& isleftAssociative(ch))){
            if(stack[top]=='(')break;
            postfix[k++]=stack[top--];
        }
        stack[++top]=ch;
    }


while (top!=-1){
    postfix[k++]=stack[top--];
    
}
postfix[k]='\0';
printf("%s\n",postfix);
}
int main(){
    char infix[MAX];
    scanf("%s",infix);
    return 0;
}