#define STACK_DEPTH 100
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
#include<math.h>

double stack[STACK_DEPTH];
int sp=STACK_DEPTH;

double pop(void){ return (sp<STACK_DEPTH)?stack[sp++]:0.0; }
void push(double f){ if(sp>0)stack[--sp]=f; }
int getword(char* dst, const char* str, int limit) {
    int i, j, len = strlen(str);
    for(i=0; i<len && isspace(str[i]); i++);
    for(j=0; j<limit && (j+i)<len && !isspace(str[i+j]); j++) dst[j]=str[i+j];
    dst[j]='\0';
    return i+j;
}

int main(void)
{
    char line[100], tmp[100];
    int i, c;
    while(1){
        i = 0;
        fgets(line, 100, stdin);
        while((c=getword(tmp, &line[i], 100)) && strlen(tmp)){
            if(strcmp(tmp, "sin")==0) push(sin(pop())); else
            if(strcmp(tmp, "cos")==0) push(cos(pop())); else
            if(strcmp(tmp, "sqr")==0) push(pow(pop(),2)); else
            if(strcmp(tmp, "+")==0) push(pop()+pop()); else
            if(strcmp(tmp, "-")==0) push(pop()-pop()); else
            if(strcmp(tmp, "*")==0) push(pop()*pop()); else
            if(strcmp(tmp, "/")==0) push(pop()/pop()); else
            if(strcmp(tmp, "=")==0) printf("%f\n", pop()); else
            push(atof(tmp));
            i+=c;
        }
        if (line[0] == '\n') break;
    }
    return 0;
}