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

x,y=map(int,raw_input().strip().split())
cj=[]
cx=[]
for i in range(x):
	n,m,s=map(str,raw_input().strip().split())
	cj.append([n,m,s])
for i in range(y):
	cx.append(raw_input())
	for j in cj:
		if cx[i]==j[0] and 90<=int(j[2]):
			score= "A"
		elif cx[i]==j[0] and 80<=int(j[2]):
			score= "B"
		elif cx[i]==j[0] and 70<=int(j[2]):
			score= "C"
		elif cx[i]==j[0] and 60<=int(j[2]):
			score= "OK"
		elif cx[i]==j[0] and 60>int(j[2]):
			score= "ARE YOU PIG?"
	print score