#include<iostream>
using namespace std;
int main()
{
string input;
int city[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 >> input ) {
int sum = 0, head = city[input[0] - 'A'];
sum += ( ( head / 10 ) + ( head % 10 ) * 9 );
for ( int i = 8, j = 1; i >= 1; i--, j++ )
sum += ( input[j] - '0' ) * i;
sum += ( input[9] - '0' );
if ( sum % 10 == 0 )
cout << "real" << endl;
else
cout << "fake" << endl;
}
return 0;
}