#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main()
{
string x;
string y[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"};
stringstream temp;
stringstream temp2;
int res=0;
while ( cin >> x )
{
int n = (int)(x[0]-65);
x.insert(0, y[n]);
x.erase(2, 1);
for (int i = 1; i<x.length()-1; i++)
{
int a;
temp << x[i];
temp >> a;
res = res + (a * (10 - i));
temp.str("");
temp.clear();
}
int a,b;
temp << x[0];
temp >> a;
temp2 << x[x.length()-1];
temp2 >> b;
res = res + a + b;
temp.str("");
temp.clear();
temp2.str("");
temp2.clear();
if (res % 10 == 0)
{
cout << "real" << endl;
}
else
{
cout << "fake" << endl;
}
}
}