#include <iostream>
using namespace std;
int main(void)
{
char a,str[9],d[9],i,j;
int b,c,e[8],f,sum=0;
while(cin>>a){
for(i=0;i<9;i++){
d[i]=0;}
if(a>='A' && a<='H')
b=a-55;
else if(a>='J' && a<='N')
b=a-56;
else if(a>='P' && a<='V')
b=a-57;
else if(a=='I')
b=34;
else if(a=='O')
b=35;
else if(a=='W')
b=32;
else if(a=='X')
b=30;
else if(a=='Y')
b=31;
else if(a=='Z')
b=33;
c=(b%10)*9;
for(i=0;i<9;i++){
cin>>str[i];
f=str[8]-'0';}
for(i=8;i>0;i--){
d[i]=str[8-i];
e[i]= d[i]-'0';}
for(j=8;j>0;j--){
sum=sum+e[j]*j;}
sum=sum+b/10+c+f;
if(sum%10==0){
cout<<"real"<<endl;}
else{
cout<<"fake"<<endl;}
sum=0;
}
system("pause");
return 0;
}
用身分證製造機去測都是對的