#include <stdio.h>
#include<math.h>
#include<iostream>
using namespace std;
int main()
{
char id[11];
int a[26]={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(cin>>id)
{
int sum=0,f;
int p,ten,one;
char h;
h=toupper(id[0]);
p=a[h-65];
one=p%10;
ten=p/10;
for(f=1;f<=8;f++)
sum=sum+(id[f]-48)*(9-f);
sum=sum+one*9+ten+id[9]-48;
if(sum%10==0)
cout<<"real"<<endl;
else
cout<<"fake"<<endl;
}
return 0;
}