#include<stdio.h>
int hot(char *c);
int main(){
char a;
while(scanf("%c",&a) != EOF){
int g,k;
int b=0,x=0,y=0,z=0,p=0;
x=(hot(a)/10)+((hot(a)%10)*9);
for(int i=8;i>=0;i--){
scanf("%d",&g);
y=g*i;
z=z+y;
if(i==1){
scanf("%d",&k);
if((x+z+k)%10 != 0){
printf("fake");
}
else{
printf("real");
}
}
}
}
return 0;
}
int hot(char *c){
int ch=toupper(c);
int b=0;
switch(ch)
{
case 'A':b=10;
break;
case 'B':b=11;
break;
case 'C':b=12;
break;
case 'D':b=13;
break;
case 'E':b=14;
break;
case 'F':b=15;
break;
case 'G':b=16;
break;
case 'H':b=17;
break;
case 'I':b=34;
break;
case 'J':b=18;
break;
case 'K':b=19;
break;
case 'L':b=20;
break;
case 'M':b=21;
break;
case 'N':b=22;
break;
case 'O':b=35;
break;
case 'P':b=23;
break;
case 'Q':b=24;
break;
case 'R':b=25;
break;
case 'S':b=26;
break;
case 'T':b=27;
break;
case 'U':b=28;
break;
case 'V':b=29;
break;
case 'W':b=32;
break;
case 'X':b=30;
break;
case 'Y':b=31;
break;
case 'Z':b=33;
break;
}
return b;
}