#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
long long fac(int a)
{
long long res = 1;
for(int i = 1; i <= a; i ++) res *= i;
return res;
}
long long solve(int a, string s, int b)
{
if(s == "+") return a + b;
if(s == "-") return a - b;
if(s == "*") return a * b;
if(s == "/") return a / b;
if(s == "%") return a % b;
return -1;
}
int main()
{
string s;
int a = 0, b = 0;
long long ans = 0;
while(cin >> a >> s)
{
if(s == "!") cout << fac(a) << endl;
else
{
cin >> b;
if(s == "/" && b == 0) cout << "error" << endl;
else if(s == "%" && b == 0) cout << "error" << endl;
else
{
ans = solve(a, s, b);
cout << ans << endl;
}
}
}
return 0;
}