Start: Jul, 06, 2019 10:00:00
20190706Python程序设计基础培训扩展练习
End: Jul, 17, 2019 12:00:00
Time elapsed:
Time remaining:

Problem_ID: C
Result: Accepted
Time: 68ms
Memory: 25312kB
Author: 13858874881
In contest: 1300

k,t=map(int,input().split())
dic1={}
dic2={10:'A',9:'A',8:'B',7:'C',6:'OK'}
for i in range(k):
    num,name,score=input().split()
    dic1[num]=[name,int(score)]
for j in range(t):
    search_num=input()
    tmp_score=dic1[search_num][1]
    if tmp_score//10 <6:
        print('ARE YOU PIG?')
    else:
        print(dic2[tmp_score//10])