#include <stdio.h>
int main() {
int a, b;
char c;
while (scanf("%d", &a) != EOF) {
scanf(" %c",&c);
if(c=='!')
{
int sum=1;
for(int i=1;i<=a;i++)
{
sum=sum*i;
}
printf("%d\n",sum);
}
else
{
scanf(" %d",&b);
if (c == '+') {
printf("%d\n", a+b);
}
if (c == '-') {
printf("%d\n", a - b);
}
if (c == '*') {
printf("%d\n", a * b);
}
if (c == '/') {
if (b == 0) {
printf("error\n");
} else {
printf("%d\n", a / b);
}
}
if (c == '%') {
if (b == 0) {
printf("error\n");
} else
printf("%d\n", a % b);
}
}
}
return 0;
}