def f(e):

 a=list([*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)

import operator

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

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

    bx, by = min(target)

    target = {(x - bx, y - by) for x, y in target}

    max_tx = max(list(map(operator.itemgetter(0), target)))

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

    max_sx = max(list(map(operator.itemgetter(0), b)))

    lim_x = max_sx - max_tx

    for x,y in b:

        if x > lim_x:continue

        for u,v in target:

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

        else:

            print((x - bx, y - by))

            break

def f(e):
    a = list([*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)

import operator

for e in iter(input, "0"):
    target = [[*list(map(int, input().split()))] for _ in [0] * int(e)]
    bx, by = min(target)
    target = {(x - bx, y - by) for x, y in target}
    max_tx = max(list(map(operator.itemgetter(0), target)))
    b = {tuple(map(int, input().split())) for _ in [0] * int(eval(input()))}
    max_sx = max(list(map(operator.itemgetter(0), b)))
    lim_x = max_sx - max_tx
    for x, y in b:
        if x > lim_x:
            continue
        for u, v in target:
            if (x + u, y + v) not in b:
                break
        else:
            print((x - bx, y - by))
            break

-def f(e): -    a = list([*map(int, input().split())] for _ in range(int(e))) -    s, t = a[0] -    b = {tuple(map(int, input().split())) for _ in range(int(input()))} +import operator + +for e in iter(input, "0"): +    target = [[*list(map(int, input().split()))] for _ in [0] * int(e)] +    bx, by = min(target) +    target = {(x - bx, y - by) for x, y in target} +    max_tx = max(list(map(operator.itemgetter(0), target))) +    b = {tuple(map(int, input().split())) for _ in [0] * int(eval(input()))} +    max_sx = max(list(map(operator.itemgetter(0), b))) +    lim_x = max_sx - max_tx -        for u, v in a[1:]: -            if (x + u - s, y + v - t) not in b: +        if x > lim_x: +            continue +        for u, v in target: +            if (x + u, y + v) not in b: -            return print(x - s, y - t) - - -for e in iter(input, "0"): -    f(e) +            print((x - bx, y - by)) +            break