for e in iter(input,'0'):

 a=[list(map(int,input().split()))for _ in[0]*int(e)]

 b=[list(map(int,input().split()))for _ in[0]*int(eval(input()))]

 for s,t in b:

  u,v=a[0]

  x,y=s-u,t-v

  for u,v in a:

   if[u+x,v+y]not in b:break

  else:print((x,y))

for e in iter(input,'0'):

 a=[list(map(int,input().split()))for _ in[0]*int(e)]

 b=[tuple(map(int,input().split()))for _ in[0]*int(eval(input()))]

 for s,t in b:

  u,v=a[0]

  x,y=s-u,t-v

  if not set((u+x,v+y)for u,v in a)-set(b):print((x,y));break

for e in iter(input, "0"):
    a = [list(map(int, input().split())) for _ in [0] * int(e)]
    b = [list(map(int, input().split())) for _ in [0] * int(eval(input()))]
    for s, t in b:
        u, v = a[0]
        x, y = s - u, t - v
        for u, v in a:
            if [u + x, v + y] not in b:
                break
        else:
            print((x, y))

for e in iter(input, "0"):
    a = [list(map(int, input().split())) for _ in [0] * int(e)]
    b = [tuple(map(int, input().split())) for _ in [0] * int(eval(input()))]
    for s, t in b:
        u, v = a[0]
        x, y = s - u, t - v
        if not set((u + x, v + y) for u, v in a) - set(b):
            print((x, y))
            break

-    b = [list(map(int, input().split())) for _ in [0] * int(eval(input()))] +    b = [tuple(map(int, input().split())) for _ in [0] * int(eval(input()))] -        for u, v in a: -            if [u + x, v + y] not in b: -                break -        else: +        if not set((u + x, v + y) for u, v in a) - set(b): +            break