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: 13175218570
In contest: 1088

x,y=map(int,raw_input().strip().split())
di1={}
di2={}
for i in range(x):
	a=raw_input().strip().split()
	di1[a[0]]=int(a[2])
	#di2[a[0]]=a[1]

for j in range(y):
	s=di1[raw_input()]
	if s in range(90,101):
		print "A"
	elif s in range(80,90):
		print "B"
	elif s in range(70,80):
		print "C"
	elif s in range(60,70):
		print "OK"
	else:
		print "ARE YOU PIG?"