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: 142ms
Memory: 21428kB
Author: 15957554881
In contest: 1088

a,b=map(int,raw_input().strip().split())
dictxs={}
for i in range(a):
    s1,s2,s3=map(str,raw_input().strip().split())
    dictxs[s1]=int(s3)
list1=[]
for i in range(b):
    list1.append(raw_input().strip())
for i in range(b):
    num=dictxs[list1[i]]
    if num>=90 and num<=100:
        print 'A'
    if num>=80 and num<90:
        print 'B'
    if num>=70 and num<80:
        print 'C'
    if num>=60 and num<70:
        print 'OK'
    if num<60:
        print 'ARE YOU PIG?'