
#include <stdio.h>

#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(void)
{
    int select;
    double data, cal1, cal2;

    reset();

    while (1) {
        if (scanf("%d", &select) != 1) {
            break;
        }

        if (select == 9) {
            break;
        }

        switch (select) {
            case 1:
                cal1 = pop();
                cal2 = pop();
                push(cal2 + cal1);
                break;

            case 2:
                cal1 = pop();
                cal2 = pop();
                push(cal2 - cal1);
                break;

            case 3:
                cal1 = pop();
                cal2 = pop();
                push(cal2 * cal1);
                break;

            case 4:
                cal1 = pop();
                cal2 = pop();
                push(cal2 / cal1);
                break;

            case 5:
                scanf("%lf", &data);
                printf("data:%f\n", data);
                push(data);
                break;
        }
    }

    answer();

    return 0;
}

void push(double value)
{
    if (!isFull()) {
        stack[sp] = value;
        sp++;
    }
}

double pop(void)
{
    if (!isEmpty()) {
        sp--;
        return stack[sp];
    }
    return 0;
}

int isFull(void)
{
    return sp == SIZE;
}

int isEmpty(void)
{
    return sp == 0;
}

void answer(void)
{
    if (!isEmpty()) {
        printf("\nanswer:%f\n", pop());
    }
}

void reset(void)
{
    sp = 0;
}
