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: 112ms
Memory: 24436kB
Author: shanzhenyu
In contest: 1124

n,m = list(map(int, input().split()))
a = {}
for t in range(n):
    s = input().split()
    a[s[0]] = [s[1],int(s[2])]

for t in range(m):
    s = input()
    b = a[s]
    score = b[1]
    if score >= 90:
        print("A")
    elif score >= 80:
        print("B")
    elif score >= 70:
        print("C")
    elif score >= 60:
        print("OK")
    else:
        print("ARE YOU PIG? ")