def f(e):

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

 b=[list(map(int,input().split()))for _ in[0]*int(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:return print(x,y)

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

while True:

    m = int(eval(input()))

    if m == 0: break

    star = list({tuple(map(int, input().split())) for i in range(m)})

    sx, sy = star[0]

    

    n = int(eval(input()))

    starset = {tuple(map(int, input().split())) for i in range(n)}

    for x, y in starset:

        flag = True

        for j in range(len(star)-1):

            dx = x + star[j+1][0] - sx

            dy = y + star[j+1][1] - sy

            if (dx, dy) not in starset:

                flag = False

                break



        if flag == True:

            print((x - sx, y - sy))

            break

    



def f(e):
    a = [list(map(int, input().split())) for _ in [0] * int(e)]
    b = [list(map(int, input().split())) for _ in [0] * int(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:
            return print(x, y)


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

while True:
    m = int(eval(input()))
    if m == 0:
        break
    star = list({tuple(map(int, input().split())) for i in range(m)})
    sx, sy = star[0]
    n = int(eval(input()))
    starset = {tuple(map(int, input().split())) for i in range(n)}
    for x, y in starset:
        flag = True
        for j in range(len(star) - 1):
            dx = x + star[j + 1][0] - sx
            dy = y + star[j + 1][1] - sy
            if (dx, dy) not in starset:
                flag = False
                break
        if flag == True:
            print((x - sx, y - sy))
            break

-def f(e): -    a = [list(map(int, input().split())) for _ in [0] * int(e)] -    b = [list(map(int, input().split())) for _ in [0] * int(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: +while True: +    m = int(eval(input())) +    if m == 0: +        break +    star = list({tuple(map(int, input().split())) for i in range(m)}) +    sx, sy = star[0] +    n = int(eval(input())) +    starset = {tuple(map(int, input().split())) for i in range(n)} +    for x, y in starset: +        flag = True +        for j in range(len(star) - 1): +            dx = x + star[j + 1][0] - sx +            dy = y + star[j + 1][1] - sy +            if (dx, dy) not in starset: +                flag = False -        else: -            return print(x, y) - - -for e in iter(input, "0"): -    f(e) +        if flag == True: +            print((x - sx, y - sy)) +            break