Start: Apr, 17, 2017 10:00:00
Python程序设计基础培训第四次作业
End: Apr, 23, 2017 14:00:00
Time elapsed:
Time remaining:

Problem_ID: C
Result: Accepted
Time: 140ms
Memory: 21432kB
Author: 13666577353
In contest: 1088

v = ["ARE YOU PIG?","ARE YOU PIG?","ARE YOU PIG?","ARE YOU PIG?","ARE YOU PIG?","ARE YOU PIG?","OK","C","B","A","A"]
n,m = map(int,raw_input().strip().split())
d = {}
for i in range(n):
    s = raw_input().strip().split()    
    d[s[0]] = int(s[2])

for i in range(m):
    print v[d[raw_input()]//10]