d = {}

for i in range(eval(input())):

  a = eval(input())

  try:

    d[a] += 1

  except KeyError:

    d[a] = 1



print(len([x for x in [d[x] for x in d] if x % 2]))

d = {}

for i in range(eval(input())):

  a = eval(input())

  d[a] = d.get(a, 0) + 1



print(len([x for x in [d[x] for x in d] if x % 2]))

d = {}
for i in range(eval(input())):
    a = eval(input())
    try:
        d[a] += 1
    except KeyError:
        d[a] = 1
print(len([x for x in [d[x] for x in d] if x % 2]))

d = {}
for i in range(eval(input())):
    a = eval(input())
    d[a] = d.get(a, 0) + 1
print(len([x for x in [d[x] for x in d] if x % 2]))

-    try: -        d[a] += 1 -    except KeyError: -        d[a] = 1 +    d[a] = d.get(a, 0) + 1