#include<stdio.h>
#include<ctype.h>
#define max 100
char stack[max];
int top=-1;
void push(char ch){
   stack[++top]=ch;
}
void pop(){
   return stack[top--];
}
int isOperator(char c){
    return (c=='+' || c=='-' || c=='*' || c=='/' );
}
int precedence(char ch){
    if(ch=='+' || ch=='-' )return 1;
    if(ch=='*' || ch=='/')return 2;
    return 0;
}

int main(){
    char infix[max],postfix[max];
    int k=0;
    scanf("%s",infix);
    
    for(int i=infix[i]!='\0';i++){
        char ch=infix[i];
        if(isalnum(ch)){
           postfix[k++]=ch;
        }
        else if(isOperator){
            while(top!=-1 && precedence(stack[top])>=precedence(ch)){
                postfix[k++]=pop();
            }
            push(ch);
        }
        else{
            printf("Invalid input");
            return 0;
        }
    }
    while(top!=-1)
        printf("%s",postfix);
    return 0;
}