n = int(eval(input()))

xl = []

lr = []

for _ in range(n):

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

    xl.append([x, l])

    lr.append([x-l, x+l])



lr.sort(key=lambda x: x[1])



ans = 0

r = -float("inf")

for i in range(n):

    if r <= lr[i][0]:

        ans += 1

        r = lr[i][1]



print(ans)

n = int(eval(input()))

d = []

for _ in range(n):

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

    d.append([x-l, x+l])



d.sort(key=lambda x: x[1])



c = -float("inf")

ans = 0

for i in range(n):

    if c <= d[i][0]:

        c = d[i][1]

        ans += 1



print(ans)

n = int(eval(input()))
xl = []
lr = []
for _ in range(n):
    x, l = list(map(int, input().split()))
    xl.append([x, l])
    lr.append([x - l, x + l])
lr.sort(key=lambda x: x[1])
ans = 0
r = -float("inf")
for i in range(n):
    if r <= lr[i][0]:
        ans += 1
        r = lr[i][1]
print(ans)

n = int(eval(input()))
d = []
for _ in range(n):
    x, l = list(map(int, input().split()))
    d.append([x - l, x + l])
d.sort(key=lambda x: x[1])
c = -float("inf")
ans = 0
for i in range(n):
    if c <= d[i][0]:
        c = d[i][1]
        ans += 1
print(ans)

-xl = [] -lr = [] +d = [] -    xl.append([x, l]) -    lr.append([x - l, x + l]) -lr.sort(key=lambda x: x[1]) +    d.append([x - l, x + l]) +d.sort(key=lambda x: x[1]) +c = -float("inf") -r = -float("inf") -    if r <= lr[i][0]: +    if c <= d[i][0]: +        c = d[i][1] -        r = lr[i][1]