n, d=list(map(int, input().split()))

cnt=0



for i in range(n):

    x, y=list(map(int, input().split()))

    tmp=(x**2 +y**2)**0.5

    if tmp<=d:

        cnt+=1



print(cnt)
n, d=list(map(int, input().split()))

cnt=0



for i in range(n):

    x, y=list(map(int, input().split()))

    tmp=x**2 + y**2

    if tmp<=d**2:

        cnt+=1



print(cnt)
n, d = list(map(int, input().split()))
cnt = 0
for i in range(n):
    x, y = list(map(int, input().split()))
    tmp = (x**2 + y**2) ** 0.5
    if tmp <= d:
        cnt += 1
print(cnt)

n, d = list(map(int, input().split()))
cnt = 0
for i in range(n):
    x, y = list(map(int, input().split()))
    tmp = x**2 + y**2
    if tmp <= d**2:
        cnt += 1
print(cnt)

-    tmp = (x**2 + y**2) ** 0.5 -    if tmp <= d: +    tmp = x**2 + y**2 +    if tmp <= d**2: