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: 113ms
Memory: 21432kB
Author: 15258500717
In contest: 1088

x,y=map(int,raw_input().strip().split())
d={}
for i in range(x):
	s=raw_input().strip().split()
	d[s[0]]=int(s[2])
for i in range(y):
	score=raw_input()
	if d[score]>=90:
		print 'A'
	elif d[score]>=80:
		print 'B'
	elif d[score]>=70:
		print 'C'
	elif d[score]>=60:
		print 'OK'
	else:
		print 'ARE YOU PIG?'