import sys
def scored(bowl_x, bowl_y, radius, throw_cords):
if (bowl_x - throw_cords[0])**2 + (bowl_y - throw_cords[1])**2 <= radius**2:
return 1
else:
return 0
x, y, r, attempts = map(float, input().split())
n = int(input())
try:
scores = {}
for _ in range(n):
name = str(input())
scores[name] = 0
for throws in range(int(attempts)):
cords = list(map(float, input().split()))
scores[name] += scored(bowl_x=x, bowl_y=y, radius=r, throw_cords=cords)
winner = max(scores, key=scores.get)
print(winner, scores[winner])
except n > 1000:
sys.exit(0)