#include #include using namespace std; char cc[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ\0"; int ccc[]= {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}; map<char,int> m; class ID{ private: int region; int num[9]; public: ID(char reg, int* n){ region = m[reg]; for(int i = 0; i < 9; i++){ num[i] = n[i]; } } void verify(){ int step2 = (region/10) + (region%10)*9; int w = 9; for(int i = 0; i < 8; i++){ step2 += num[i] * w; w --; } step2 += num[8]; if(step2%10 == 0) cout << "real\n"; else cout << "fake\n"; } }; int main(){ string s; int number[9]; while(cin >> s){ //get first char = c char c = s.front(); //get number array = number[] string num = s.substr(1,9); for(int i = 0; i < 9; i++){ number[i] = num.at(i)-'0'; } //set map for(int i = 0; i < 26; i++){ char c1 = cc[i]; m[c1] = ccc[i]; } ID person(c,number); person.verify(); } return 0; }