while 1:
    f = []; s = [];
    m = input()
    if m==0: break
    for i in xrange(m):
        f.append(map(int, raw_input().split()))
    n = input()
    for i in xrange(n):
        s.append(map(int, raw_input().split()))
    for i in range(n):
        x0 = s[i][0] - f[0][0]
        y0 = s[i][1] - f[0][1]
        flg = True
        for j in range(m):
            ff = [f[j][0]+x0, f[j][1]+y0]
            if not (ff in s):
                 flg = False; break;
        if flg:
            print "%d %d"%(x0, y0)
            break;