while 1:
    f = []; s = [];
    m = input()
    if m==0: break
    comp = lambda x, y: cmp(x[1],y[1]) if x[0]==y[0] else cmp(x[0], y[0])
    for i in xrange(m):
        f.append(map(int, raw_input().split()))
    f.sort(cmp = comp)
    n = input()
    for i in xrange(n):
        s.append(map(int, raw_input().split()))
    s.sort(cmp = comp)

    for i in xrange(n):
        x0 = s[i][0] - f[0][0]
        y0 = s[i][1] - f[0][1]
        c = 1
        for j in xrange(i+1,n):
            if f[c][0]+x0==s[j][0] and f[c][1]+y0==s[j][1]:
                c+=1
            elif f[c][0]+x0<s[j][0] or (f[c][0]+x0==s[j][0] and f[c][1]+y0<s[j][1]):
                break
            if c==m : break;
        if c==m: break
    print "%d %d"%(x0, y0)