import numpy as np
while 1:
    n = input()
    if n == 0: break
    p = np.array(sorted([map(int, raw_input().split()) for i in range(n)]))
    dist = [p[i] - p[0] for i in range(1,n)]
    m = input()
    q = np.array(sorted([map(int, raw_input().split()) for i in xrange(m)]))
    for p1 in q:
        for i in range(n-1):
            f = True
            for p2 in q:
                if np.all(p1 + dist[i] == p2):
                    f = False
                    break
            if f: break
        else:
            print p1[0] - p[0][0], p1[1] - p[0][1]