from copy import deepcopy
while True:
    try:
        a,da, b = [], [], []
        m = int(raw_input())
        for i in range(m):
            a.append(map(int, raw_input().split()))
        a = sorted(a)
        da = deepcopy(a)
        for i in range(1,len(da)+1):
            da[-i][0] -= da[0][0]
            da[-i][1] -= da[0][1]
        n = int(raw_input())
        for i in range(n):
            b.append(map(int, raw_input().split()))
        b = sorted(b)
        bx,by = [],[]
        for i in b:
            bx.append(i[0])
            by.append(i[1])
        for i in range(n):
            for d in da:
                if bx.count(bx[i]+d[0]) == 0 or by.count(by[i]+d[1]) == 0:
                	break
            else:
                print b[i][0]-a[i][0],b[i][1]-a[i][1]
                break
    except:
        break