#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int Stack[1000];
int top = 0;

void push(int x);
int pop();

int main() {
	
	int a, b;
	char s[100];

	while(scanf("%s",s) != EOF){
		if (s[0] == '+') {
			a = pop();
			b = pop();
			push(a + b);
			printf("c\n");
		}
		else if (s[0] == '-') {
			a = pop();
			b = pop();
			push(a - b);
			printf("d\n");
		}else if(s[0] == '*'){
			a = pop();
			b = pop();
			push(a * b);
			printf("e\n");
		}else{
			printf("a\n");
			push(atoi(s));
		}
	}

	printf("%d\n", pop());

	return 0;

}

void push(int x) {

	top++;
	Stack[top] = x;

}

int pop() {

	top--;

	return Stack[top++];
}