def int_array_input():
    return map(int, raw_input().split(' '))

while True:
    n = int(raw_input())
    if n == 0:
        break

    stars = [tuple(int_array_input()) for x in xrange(n)]

    m = int(raw_input())
    sky = set(tuple(int_array_input()) for x in xrange(m))

    for (nx, ny) in sky:
        dx = nx - stars[0][0]
        dy = ny - stars[0][1]

        f = True

        for (tx, ty) in stars[1:]:
            tx += dx
            ty += dy
            if not ((tx, ty) in sky):
                f = False
                break

        if f:
            print dx, dy
            break