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: 95ms
Memory: 24300kB
Author: jszxl
In contest: 1124

n,m=list(map(int,input().split()))
dic1={}
for i in range(n):
  xh,xm,cj=list(map(str,input().split()))
  dic1[xh]=int(cj)

#print(dic1)
for i in range(m):
  xhh=input()
  score=dic1[xhh]
  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?")