#include <iostream>
using namespace std;

int jie(int n){
	if(n==0||n==1){
		return 1;
	}else{
		return n*jie(n-1);
	}
}

void math(int a,char b,int c){
	switch(b){
		case '+':
			cout<<a+c<<endl;
			break;
		case '-':
			cout<<a-c<<endl;
			break;
		case '*':
			cout<<a*c<<endl;
			break;
		case '/':
			if(c==0){
				cout<<"error"<<endl;
			}else{
				cout<<a/c<<endl;
			}
			break;
		case '%':
			if(c==0){
				cout<<"error"<<endl;
			}else{
				cout<<a%c<<endl;
			}
			break;
		default:
			cout<<"error"<<endl;
	}
}
int main(){
	int a,c;
	char b;
	while(cin>>a>>b){
		if(b=='!'){
			cout<<jie(a)<<endl;
		}else{
			cin>>c;
			math(a,b,c);
		}
	}
	return 0;
}