#include <iostream>
using namespace std;
int main()
{
char id[10];
int nu[10],fi[10],f=0;
while(cin>>id){
for(int i=1;i<=9;i++){
nu[i]=(int) id[i]-48;
}
switch(id[0]){
case 'A':
nu[0]=10;
break;
case 'B':
nu[0]=11;
break;
case 'C':
nu[0]=12;
break;
case 'D':
nu[0]=13;
break;
case 'E':
nu[0]=14;
break;
case 'F':
nu[0]=15;
break;
case 'G':
nu[0]=16;
break;
case 'H':
nu[0]=17;
break;
case 'I':
nu[0]=34;
break;
case 'J':
nu[0]=18;
break;
case 'K':
nu[0]=19;
break;
case 'L':
nu[0]=20;
break;
case 'M':
nu[0]=21;
break;
case 'N':
nu[0]=22;
break;
case 'O':
nu[0]=35;
break;
case 'P':
nu[0]=23;
break;
case 'Q':
nu[0]=24;
break;
case 'R':
nu[0]=25;
break;
case 'S':
nu[0]=26;
break;
case 'T':
nu[0]=27;
break;
case 'U':
nu[0]=28;
break;
case 'V':
nu[0]=29;
break;
case 'W':
nu[0]=32;
break;
case 'X':
nu[0]=30;
break;
case 'Y':
nu[0]=31;
break;
case 'Z':
nu[0]=33;
break;
}
fi[0]=nu[0]%10*9+nu[0]/10;
for(int i=2;i<=9;i++)
fi[10-i]=nu[10-i]*(i-1);
fi[9]=nu[9];
for(int i=0;i<=9;i++){
f+=fi[i];
//cout<<"fi["<<i<<"]="<<fi[i]<<endl;(測試用)
}
if(f%10==0)
cout<<"real"<<endl;
else
cout<<"fake"<<f<<endl;
}
}