import operator
for e in iter(input,'0'):
    target = [[*map(int,input().split())]for _ in[0]*int(e)]
    s,t = min(target)
    b = {tuple(map(int,input().split()))for _ in[0]*int(input())}
    m=max(b)[0] - max(target)[0] + s
    for x,y in b:
        if x>m:continue
        for u,v in target:
            if (x + u - s, y + v - t) not in b:break
        else:
            print(x - s, y - t)
            break
