#include<iostream>
#include<cstring>
using namespace std;
int main()
{
char in[10];
while(cin >> in)
{
int num=0,num1=0,num2=0,i=65,j=1,k=0;
while(num==0)
{
if(int(in[0])==i)
{
if(i==73)
num1=3,num2=4;
else if(i==87)
num1=3,num2=5;
else if(i==87)
num1=3,num2=2;
else
num1=j,num2=k;
}
else
{
i++;k++;
if(i==73||i==87||i==79)
k--;
if(k==10)
k=0,j++;
}
num+=num1+num2*9;
}
for(int a=1,b=8;a<=strlen(in);a++,b--)
{
if(b==0)
b++;
if(int(in[a])==49)
num+=1*b;
else if(int(in[a])==50)
num+=2*b;
else if(int(in[a])==51)
num+=3*b;
else if(int(in[a])==52)
num+=4*b;
else if(int(in[a])==53)
num+=5*b;
else if(int(in[a])==54)
num+=6*b;
else if(int(in[a])==55)
num+=7*b;
else if(int(in[a])==56)
num+=8*b;
else if(int(in[a])==57)
num+=9*b;
}
if(num%10==0)
cout<<"real";
else
cout<<"fake";
cout << endl;
}
return 0;
}