HZNUOJ


Problem_ID: C
Result: Accepted
Time: 56ms
Memory: 25312kB
Author: 13806858827
In contest: 1296

n,m=map(int,input().split())
d={}
for tcase in range(n):
    a=input().split()
    d[a[0]]=int(a[2])
for tcase in range(m):
    x=d[input()]
    if x>=90:print("A")
    elif x>=80:print("B")
    elif x>=70:print("C")
    elif x>=60:print("OK")
    else: print("ARE YOU PIG?")