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: 49ms
Memory: 25316kB
Author: 13819973890
In contest: 1300

dic1={10:'A',9:'A',8:'B',7:'C',6:'OK'}
x,y=map(int,input().split())
ls=[]
for i in range(x):
    ls.append(input().split())
lsb=[]
for i in range(y):
    lsb.append(input())
for j in lsb:
    m=j
    for i in range(x):
        if m==ls[i][0]:
            if int(ls[i][2])<60:
                print('ARE YOU PIG? ')
            else:
                t1=int(ls[i][2])//10
                print(dic1[t1])
            break