import java.util.*;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author wade
*/
public class ChkID {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner scn=new Scanner(System.in);
String ckID;
while(scn.hasNext()){
ckID=scn.nextLine();
splitID(ckID);
}
}
public static void splitID(String strID) //將身分證字號分解放入整數陣列;
{
int[] intIDarr = new int[10];
for (int i = 0; i < 10; i++){
if (i == 0){
intIDarr[0] = getCTNum(strID.substring(0,1));
//System.out.print("intIDarr[0]= "+intIDarr[0]+" \n");
}else{
intIDarr[i] = Integer.parseInt(strID.substring(i,i+1));
//System.out.print("intIDarr["+i+"]= "+intIDarr[i]+" ");
}
}
chkNewID(intIDarr);
}
public static void chkNewID(int[] arrID)
{
int chkIDarr,checker;
//int CTcode=arrID[0]/10;
chkIDarr = (arrID[0]/10) + (arrID[0]%10) * 9 + arrID[1] * 8 + arrID[2] * 7 + arrID[3] * 6 + arrID[4] * 5 + arrID[5] * 4 + arrID[6] * 3 + arrID[7] * 2 + arrID[8] * 1 + arrID[9] ;
/*
System.out.println("arrID[0]/10--->"+arrID[0]/10);
System.out.println("arrID[0]%10--->"+(arrID[0]%10)*9);
System.out.println("arrID[1]--->"+arrID[1]+"*8= "+arrID[1]*8);
System.out.println("arrID[2]--->"+arrID[2]+"*7= "+arrID[2]*7);
System.out.println("arrID[3]--->"+arrID[3]+"*6= "+arrID[3]*6);
System.out.println("arrID[4]--->"+arrID[4]+"*5= "+arrID[4]*5);
System.out.println("arrID[5]--->"+arrID[5]+"*4= "+arrID[5]*4);
System.out.println("arrID[6]--->"+arrID[6]+"*3= "+arrID[6]*3);
System.out.println("arrID[7]--->"+arrID[7]+"*2= "+arrID[7]*2);
System.out.println("arrID[8]--->"+arrID[8]+"*1= "+arrID[8]*1);
System.out.println("arrID[9]--->"+arrID[9]);
System.out.println(chkIDarr);*/
checker = chkIDarr % 10;
if(arrID[1]==0||arrID[1]>2){
System.out.println(chkIDarr+"fake");
}else if(checker==1){
System.out.println("fake");
}else if(checker==2){
System.out.println("real");
}else if(checker==3){
System.out.println(checker+"fake");
}else if(checker==4){
System.out.println(checker+"fake");
}else if(checker==5){
System.out.println(checker+"fake");
}else if(checker==6){
System.out.println(checker+"fake");
}else if(checker==7){
System.out.println("fake");
}else if(checker==8){
System.out.println(checker+"fake");
}else if(checker==9){
System.out.println("fake");
}else{
System.out.println("real");
}
}
public static int getCTNum(String CTStr){ // 區碼轉換成數字;
/*A=10 台北市 B=11 台中市 C=12 基隆市 D=13 台南市 E=14 高雄市 F=15 台北縣 G=16 宜蘭縣
H=17 桃園縣 I=34 嘉義市 J=18 新竹縣 K=19 苗栗縣 L=20 台中縣 M=21 南投縣 N=22 彰化縣
O=35 新竹市 P=23 雲林縣 Q=24 嘉義縣 R=25 台南縣 S=26 高雄縣 T=27 屏東縣 U=28 花蓮縣
V=29 台東縣 W=32 金門縣 X=30 澎湖縣 Y=31 陽明山 Z=33 連江縣 */
int CTNum=0;
switch (CTStr){
case "A":
CTNum = 10;
break;
case "B":
CTNum = 11;
break;
case "C":
CTNum = 12;
break;
case "D":
CTNum = 13;
break;
case "E":
CTNum = 14;
break;
case "F":
CTNum = 15;
break;
case "G":
CTNum = 16;
break;
case "H":
CTNum = 17;
break;
case "J":
CTNum = 18;
break;
case "K":
CTNum = 19;
break;
case "L":
CTNum = 20;
break;
case "M":
CTNum = 21;
break;
case "N":
CTNum = 22;
break;
case "P":
CTNum = 23;
break;
case "Q":
CTNum = 24;
break;
case "R":
CTNum = 25;
break;
case "S":
CTNum = 26;
break;
case "T":
CTNum = 27;
break;
case "U":
CTNum = 28;
break;
case "V":
CTNum = 29;
break;
case "X":
CTNum = 30;
break;
case "Y":
CTNum = 31;
break;
case "W":
CTNum = 32;
break;
case "Z":
CTNum = 33;
break;
case "I":
CTNum = 34;
break;
}
return CTNum;
}
}