#include <stdio.h>//ideoneのプログラミング

#define SIZE 10
double stack[SIZE];
int sp;

void push(double value);
double pop(void);
int isFull(void);
int isEmpty(void);
void answer(void);
void reset(void);
int main() {
reset();
while(1){
int resp;
double data,a,b;

scanf("%d",&resp);

if(resp==9) break;

switch(resp){
case 1:
    b=pop();
    a=pop();
    push(a+b);
    break;
case 2:
    b=pop();
    a=pop();
    push(a-b);
    break;
case 3:
    b=pop();
    a=pop();
    push(a*b);
    break;
case 4:
    b=pop();
    a=pop();
    push(a/b);
    break;
case 5:
    scanf("%lf",&data);
    printf("data:%f\n",data);
    push(data);
    break;
}

}

answer();

return 0;
}

void push(double value){
if( isFull() ){
printf("スタックが満杯で入りませんでした\n");
}
else{
stack[sp++]=value;
}
}

double pop(void){
if( isEmpty() ){
printf("スタックが空で取り出せませんでした\n");
return 0;
}
else{
return stack[--sp];
}
}

int isFull(void){
if(sp>=SIZE){
return 1;
}
else{
return 0;
}
}

int isEmpty(void){
if(sp<=0){
return 1;
}
else{
return 0;
}
}

void answer(void){
printf("\n");
if(sp>0){
printf("answer:%f\n",stack[sp-1]);
}
}

void reset(void){
sp=0;
}