#include <bits/stdc++.h>
using namespace std;
int main(){
string a;
cin>>a;
int count=0;
if (a[0] == 'A') count += 1;
else if (a[0] == 'B') count += 10;
else if (a[0] == 'C') count += 19;
else if (a[0] == 'D') count += 28;
else if (a[0] == 'E') count += 37;
else if (a[0] == 'F') count += 46;
else if (a[0] == 'G') count += 55;
else if (a[0] == 'H') count += 64;
else if (a[0] == 'I') count += 39;
else if (a[0] == 'J') count += 73;
else if (a[0] == 'K') count += 82;
else if (a[0] == 'L') count += 2;
else if (a[0] == 'M') count += 11;
else if (a[0] == 'N') count += 20;
else if (a[0] == 'O') count += 48;
else if (a[0] == 'P') count += 29;
else if (a[0] == 'Q') count += 38;
else if (a[0] == 'R') count += 47;
else if (a[0] == 'S') count += 56;
else if (a[0] == 'T') count += 65;
else if (a[0] == 'U') count += 74;
else if (a[0] == 'V') count += 83;
else if (a[0] == 'W') count += 21;
else if (a[0] == 'X') count += 3;
else if (a[0] == 'Y') count += 12;
else if (a[0] == 'Z') count += 30;
//上面是判斷第一個字 英文轉成的數字, 個位數乘9再加上十位數的數字
for(int i=1;i<9;i++){
count+=(a[a.length()-i-1]-'0')*i;
}
// 各數字從右到左依次乘1、2、3、4....8
count+=(a[9]-'0');
//求出(2),(3) 及最後一碼的和
if((count%10)==0) cout<<"real"<<endl;
else cout<<"fake"<<endl;
//(4)除10 若整除,則為 real,否則為 fake
}