Start: Nov, 12, 2017 10:00:00
2017秋Python程序设计基础培训第四次作业
End: Nov, 19, 2017 12:00:00
Time elapsed:
Time remaining:

Problem_ID: C
Result: Accepted
Time: 111ms
Memory: 24300kB
Author: lijian3256
In contest: 1124

n, m = map(int,input().split())
a = []
for i in range(n):
    s = input().split()
    a.append([s[0], int(s[2])])
for i in range(m):
    h = input()
    for j in range(n):
        if h == a[j][0]:
            s = a[j][1]
            break;
    if s>=90: print("A")
    elif s>=80: print("B")
    elif s>=70: print("C")
    elif s>=60: print("OK")
    else: print("ARE YOU PIG?")