//Strange Mathematical Expression
#include<bits/stdc++.h>
using namespace std;

stack<double> s;

int main(){
  char t;
  double tmp=0.0;
  while(scanf("%1c", &t)!=EOF){
    if('0'<=t&&t<='9'){tmp=tmp*10+(t-'0'); continue;}
    if(t==' '){
      if(tmp==0.0)continue;
      s.push(tmp); tmp=0.0; continue;
    }
    if(t=='+'){
      double c1, c2;
      c1=s.top(); s.pop();
      c2=s.top(); s.pop();
      s.push(c1+c2);
      continue;
    }
    if(t=='-'){
      double c1, c2;
      c1=s.top(); s.pop();
      c2=s.top(); s.pop();
      s.push(c2-c1);
      continue;
    }
    if(t=='*'){
      double c1, c2;
      c1=s.top(); s.pop();
      c2=s.top(); s.pop();
      s.push(c1*c2);
      continue;
    }
    if(t=='/'){
      double c1, c2;
      c1=s.top(); s.pop();
      c2=s.top(); s.pop();
      s.push(c2/c1);
      continue;
    }
    if(t=='\n'){
      printf("%.8f\n", s.top());
      while(!s.empty())s.pop();
    }
  }
  return 0;
}