#include <stdio.h>

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

void pushu(double value);
double pop(void);
int isFull(void);
int isEmpty(void);
void reset(void);

int main(void) {
	reset();
	
	while(1){
		double data;
		double cal1,cal2;
		int resp;
		
		scanf("%d",&resp);
		
		if(resp==9) break;
		
		switch(resp){
			case 1: cal1 = pop();
				cal2 = pop();
				pushu(cal2+cal1);
				break;
				
			case 2: cal1 = pop();
				cal2 = pop();
				pushu(cal2-cal1);
				break;
				
			case 3: cal1 = pop();
				cal2 = pop();
				pushu(cal2*cal1);
				break;
				
			case 4: cal1 = pop();
				cal2 = pop();
				pushu(cal2/cal1);
				break;
			
			case 5: printf("data"); scanf("%lf",&data);
				pushu(data);
				printf("%lf\n",data);
				break;
	}
}
		answer();
		return 0;
}

void pushu(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");
	printf("answer:%lf\n",stack[0]);
}
void reset(void){
	while(!isEmpty())
	pop();
}