Start: Apr, 17, 2017 10:00:00
Python程序设计基础培训第四次作业
End: Apr, 23, 2017 14:00:00
Time elapsed:
Time remaining:

Problem_ID: C
Result: Accepted
Time: 89ms
Memory: 21432kB
Author: 13600545642
In contest: 1088

x,y=map(int,raw_input().strip().split())
dic={}
for i in range(x):
    z=raw_input().strip().split()
    dic[z[0]]=int(z[2])

for i in range(y):
    a=dic[raw_input()]
    if a>=90 and a<=100:
        print 'A'
    elif a>=80:
        print 'B'
    elif a>=70:
        print 'C'
    elif a>=60:
        print 'OK'
    else:
        print 'ARE YOU PIG?'