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

 a=list(tuple(map(int,input().split())) for _ in range(int(e)))

 s,t=a[0]

 b={tuple(map(int,input().split())) for _ in range(int(eval(input())))}

 for x,y in b:

  for u,v in a[1:]:

   if(x+u-s,y+v-t)not in b:break

  else:print((x-s,y-t));break

def f(e):

 a=list(tuple(map(int,input().split())) for _ in range(int(e)))

 s,t=a[0]

 b={tuple(map(int,input().split())) for _ in range(int(input()))}

 for x,y in b:

  for u,v in a[1:]:

   if(x+u-s,y+v-t)not in b:break

  else:return print(x-s,y-t)

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

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

def f(e):
    a = list(tuple(map(int, input().split())) for _ in range(int(e)))
    s, t = a[0]
    b = {tuple(map(int, input().split())) for _ in range(int(input()))}
    for x, y in b:
        for u, v in a[1:]:
            if (x + u - s, y + v - t) not in b:
                break
        else:
            return print(x - s, y - t)


for e in iter(input, "0"):
    f(e)

-for e in iter(input, "0"): +def f(e): -    b = {tuple(map(int, input().split())) for _ in range(int(eval(input())))} +    b = {tuple(map(int, input().split())) for _ in range(int(input()))} -            print((x - s, y - t)) -            break +            return print(x - s, y - t) + + +for e in iter(input, "0"): +    f(e)