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

dic = {10:'A',9:'A',8:'B',7:'C',6:'OK'}
x,y = map(int,input().split())
dic_students={}
for i in range(x):
    student_num,name,score=input().split()
    dic_students.update({student_num:[name,int(score)]})
for j in range(y):
    search_num = input()
    if dic_students[search_num][1] < 60:
        print('ARE YOU PIG?')
    else:
        print(dic[dic_students[search_num][1]//10])