#include<stdio.h>
#include<stdlib.h>
int main(void){
  int i;
  char A[100];
  int ans;
  for(i=0;;i++){
    if(scanf("%c ",&A[i])==EOF)break;
    printf("%c",A[i]);
   if(A[i]=='+'){
      i=i-2;
      if(A[i]>48){
	A[i]=A[i]-48;
      }
       if(A[i+1]>48){
	A[i+1]=A[i+1]-48;
      }
     
      A[i]=A[i+1]+A[i];
    printf("%d ",A[i]);

   }
    else if(A[i]=='-'){
      i=i-2;
      if(A[i]>48){
	A[i]=A[i]-48;
      }
       if(A[i+1]>48){
	A[i+1]=A[i+1]-48;
      }
          A[i]=A[i+1]-A[i];
    printf("%d  ",A[i]);

    }
    else if(A[i]=='*'){
      i=i-2;
       if(A[i]>48){
	A[i]=A[i]-48;
      }
       if(A[i+1]>48){
	A[i+1]=A[i+1]-48;
      }
       printf("%d %d ",A[i],A[i+1]);
      A[i]=A[i+1]*A[i];
    printf("%d   ",A[i]);


   }
  }


  printf("%d\n",A[i-1]);
  return 0;
}