dic = { "A": 10, "J": 18, "S": 26,
"B": 11, "K": 19, "T": 27,
"C": 12, "L": 20, "U": 28,
"D": 13, "M": 21, "V": 29,
"E": 14, "N": 22, "W": 32,
"F": 15, "O": 35, "X": 30,
"G": 16, "P": 23, "Y": 31,
"H": 17, "Q": 24, "Z": 33,
"I": 34, "R": 25 }
su=0
b=str(input()) #輸入身分證 E123456789
c=b[::-1] #倒轉的身分證字號 987654321E
d=c[:-1] #把最後一個英文和刪掉 987654321
e=b[0] #身分證第一碼 E
f=b[-1] #最後一馬
g=dic[e]
for i in range (9):
su += int(d[i])*i
h=(int(f)+su+(g%10)*9+g//10)
if (h%10 == 0):
print("real")
else:
print("fake")
dic = { "A": 10, "J": 18, "S": 26,
"B": 11, "K": 19, "T": 27,
"C": 12, "L": 20, "U": 28,
"D": 13, "M": 21, "V": 29,
"E": 14, "N": 22, "W": 32,
"F": 15, "O": 35, "X": 30,
"G": 16, "P": 23, "Y": 31,
"H": 17, "Q": 24, "Z": 33,
"I": 34, "R": 25 }
su=0
b=str(input()) #輸入身分證 E123456789
c=b[::-1] #倒轉的身分證字號 987654321E
d=c[:-1] #把最後一個英文和刪掉 987654321
e=b[0] #身分證第一碼 E
f=b[-1] #最後一馬
https://www.youtube.com/watch?v=072tU1tamd0
g=dic[e]
for i in range (9):
su += int(d[i])*i
h=(int(f)+su+(g%10)*9+g//10)
if (h%10 == 0):
print("real")
else:
print("fake")