#include<stdio.h>
#include<ctype.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 precedence(char op){
    if (op == '+' || op == '-')return 1;
    if(op == '*' || op == '/')return 2;
    return 0;
}
int main (){
    char infix[MAX];
    scanf("%s",infix);
    char postfix[MAX];
    int j =0;
    for (int i=0; infix[i] != '\0'; i++){
        char ch = infix[i];
        if (isalnum(ch)){
            pistfix[j++]=ch;
        }
        else if(ch =='('){
            push(ch);
        }
        else if (ch ==')'){
            while(top != -1 && precesence(peek())<=precedence(ch)){
                postfix[j++]=pop();
            }
            push(ch);
        }
    }
    while(top != -1){
        postfix[j++] =pop();
    }
    postfix[j]='\0';
    prinrf("%s",postfix);
    return 0;
}