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: 25312kB
Author: 13758494551
In contest: 1300

def pd(x):
    if x>=90 and x<=100:
        return "A"
    elif x>=80 and x<90:
        return "B"
    elif x>=70 and x<80:
        return "C"
    elif x>=60 and x<70:
        return "OK"
    else:
        return "ARE YOU PIG?"
    
x,y=map(int,input().split())
s1,s2=[],[]
for i in range(x):
    s2.append(list(input().split()))
for j in range(y):
    s1.append(input())
for p in s1:
    for j in s2:
        if p in j:
            print(pd(int(j[2])))