#include <iostream>
#include <string>
using namespace std;
int main(void) {
int data[] = { 1, 10, 19, 28, 37, 46, 55, 64, 39, 73, 82, 2, 11,
20, 18, 29, 38, 47, 56, 65, 74, 83, 21, 3, 12, 30};
string str;
while(cin >> str) {
int top, discriminant,num[9] = {0}, index = 0;
top = data[str[0] - 65];
for(int i = 1; i <= 9; i++) {
if(i == 9) {
num[index] = str[i] - 48;
break;
}
num[index] = (str[i] - 48) * (9 - i); index++;
}
discriminant = top;
for(int i = 0; i <= 8; i++)
discriminant += num[i];
cout << (discriminant % 10 == 0 ? "real" : "fake") << endl;
}
return 0;
}