#include <stdio.h>
#include <string.h>
main()
{
int i, j, s;
char a[10];
char b[]={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};
while(scanf("%s", &a) != EOF)
{
s = a[9]-'0';
for(i=9;i>0;i--)
s += (a[i] - '0') * (9-i);
j = a[0]-'A';
s += (b[j]%10)*9 + (b[j]/10);
if((s%10)==0)
printf("real\n");
else
printf("fake\n");
}
return 0;
}