#include <cstdlib>
#include <iostream>
#include <cmath>
using namespace std;
typedef unsigned long long int uint64;
uint64 POW(unsigned int a,unsigned int n)
{
if (n==1) return a;
uint64 temp = POW(a,n/2);
temp *= temp;
if (n&0x01) temp *= a;
return temp;
}
int main(void)
{
enum SIGN{Negtive = -1 , Positive = 1};
SIGN sign;
unsigned int a,n;
char str[1000];
while(gets(str))
{
int strEnd = (int)strlen(str);
int i=0;
a=0;
sign = Positive;
for (i=0;i<strEnd;i++) {
if (str[i]>='0' && str[i]<='9') a = a*10 + str[i] - '0';
else if (str[i]=='-') sign = Negtive;
else break;
}
if ((a==1)&&(sign==Positive)) {
cout << "1\n";
continue;
}
else if ((a==1)&&(sign==Negtive)) {
char buf;
for (;i<strEnd;i++) {
if (str[i]>='0' && str[i]<='9') buf = str[i];
}
cout << ( (buf-'0')&0x01 ? "-1\n" : "1\n");
continue;
}
else if (a==0) {
for (;i<strEnd;i++) if (str[i]>='0' && str[i]<='9') n += str[i] - '0';
if (n==0) cout << "All Over.\n";
else {
cout << "0\n";
return 0;
}
continue;
}
else {
n=0;
for (;i<strEnd;i++) {
if (str[i]>='0' && str[i]<='9') {
n = n*10 + (str[i] - '0');
}
}
uint64 ans = POW(a,n);
if (sign==Negtive) cout << "-";
cout << ans << endl;
}
}
return 0;
}