var filterFloat = function (value) {
    if(/^(\-|\+)?([0-9]+(\.[0-9]+)?|Infinity)$/
      .test(value))
      return true;
  return false;
}

var reversePolishNotationCalc = function (arr) {
    var checking = 0;
    while(checking < arr.length) {
        switch(arr[checking]) {
            case "+":
                var ans = arr[checking - 1] + arr[checking - 2];
                arr.splice(checking - 2, 3, ans);
                checking = checking - 2;
                break;
            case "-":
                var ans = arr[checking - 1] - arr[checking - 2];
                arr.splice(checking - 2, 3, ans);
                checking = checking - 2;
                break;
            case "*":
                var ans = arr[checking - 1] * arr[checking - 2];
                arr.splice(checking - 2, 3, ans);
                checking = checking - 2;
                break;
            case "/":
                var ans = arr[checking - 1] / arr[checking - 2];
                arr.splice(checking - 2, 3, ans);
                checking = checking - 2;
                break;
            default:
                arr[checking] = parseFloat(arr[checking]);
                checking++;
                console.log(arr);
                break;
        }
    }
    console.log(arr[0].toFixed(6));
}

var cin=new java.util.Scanner(java.lang.System.in);
for(;cin.hasNext();){
    var arr = cin.split(" ");
    reversePolishNotationCalc(arr);
}

for(let formula of cin){
    arr = formula.split(" ");
    reversePolishNotationCalc(arr);
}