#include <stdio.h>
int main()
{
char eng[]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
int math[]={10,11,12,13,14,15,16,17,34,18,19,20,21,22,35,23,24,25,26,27,28,29,32,30,31,33};
char id[11];
int i,j,p;
while(scanf("%c",&id[0])!=EOF)
{
int sum=0;
for(i=0;i<26;i++)
{
if(id[0]==eng[i])
{
j=i;
break;
}
}
for(i=1;i<10;i++)
{
scanf("%c",&id[i]);
sum+=(id[i]-'0')*(9-i);
}
sum+=math[j]/10+math[j]%10*9;
sum+=(id[9]-'0');
if(sum%10==0)
{
printf("real\n");
}
else
{
printf("fake\n");
}
}
return 0;
}