#include <bits/stdc++.h>
using namespace std;
stack<char> op;
stack<double> num;
unordered_map<char, int> pr;
void eval(){
auto b = num.top();
num.pop();
auto a = num.top();
num.pop();
auto c = op.top();
op.pop();
double x;
if (c == '+'){
x = a + b;
}
else if (c == '-'){
x = a - b;
}
else if (c == '*'){
x = a * b;
}
else{
x = a / b;
}
num.push(x);
}
int main(){
pr['+'] = 1;
pr['-'] = 1;
pr['*'] = 2;
pr['/'] = 2;
string str;
while (getline(cin, str)){
if (str == "0") break;
for (int i=0; i<str.size();i++){
int ch = str[i];
if (isdigit(ch)){
double x = 0, j = i;
while(j<str.size() && isdigit(str[j])){
x = x * 10 + (str[j] - '0');
j ++;
}
num.push(x);
i = j - 1;
}
else {
if (ch == ' ') continue;
while (op.size() && pr[op.top()] >= pr[ch]) eval();
op.push(ch);
}
}
while (op.size()) eval();
printf("%.2lf\n", num.top());
num.pop();
}
return 0;
}