#include <iostream>
#include <stack>
#include <string>
#include <map>
#include <iomanip>
using namespace std;
int main() {
string s;
map<char, int> rank = {{'+', 1}, {'-', 1}, {'*', 2}, {'/', 2}, {'.', 0}};
while (getline(cin, s)) {
if (s == "0") break;
s.push_back('.');
stack<char>op;
stack<float> num;
string r;
for (int i = 0; i < s.size(); ++i) {
if (s[i] <= '9' && s[i] >= '0') r.push_back(s[i]);
else if (s[i] != ' ') {
float temp = stof(r);
num.push(temp);
r.clear();
while (!op.empty() && rank[op.top()] >= rank[s[i]]) {
float rhs = num.top();
num.pop();
float lhs = num.top();
num.pop();
char c = op.top();
op.pop();
if (c == '+') num.push(lhs + rhs);
else if (c == '-') num.push(lhs - rhs);
else if (c == '*') num.push(lhs * rhs);
else if (c == '/') num.push(lhs / rhs);
}
if (s[i] == '.') cout << setiosflags(ios::fixed) << setprecision(
2) << num.top() << endl;
else op.push(s[i]);
}
}
}
return 0;
}