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)
        dax,day = [],[]
        for i in range(m):
            dax.append(a[i][0]-a[0][0])
            day.append(a[i][1]-a[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-m+1):
            for j in range(m):
                if bx.count(bx[i]+dax[j]) == 0 or by.count(by[i]+day[j]) == 0:
                    break
            else:
                print bx[i]-a[0][0],by[i]-a[0][1]
                break
    except:
        break