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: 50ms
Memory: 25196kB
Author: 15857019277
In contest: 1300

n,m = list(map(int, input().split()))
d = {10:"A",9:"A",8:"B",7:"C",6:"OK"}
a = {}
for t in range(n):
    s = input().split()
    a[s[0]] = [s[1],int(s[2])]

for t in range(m):
    score = a[input()][1]
    if score >= 60:
        print(d[score//10])
    else:
        print("ARE YOU PIG? ")