import operator

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

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

    bx, by = target[0]

    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

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

import operator

for e in iter(input, "0"):
    target = [[*list(map(int, input().split()))] for _ in [0] * int(e)]
    bx, by = target[0]
    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

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

-    bx, by = target[0] +    bx, by = min(target)