while 1:
    m = int(raw_input())
    if m == 0:
        break
    mxys = [map(int, raw_input().split()) for i in range(m)]
    nxys = set(tuple(map(int, raw_input().split())) for i in range(int(raw_input())))
    for nxy in nxys:
        dx = nxy[0] - mxys[0][0]
        dy = nxy[1] - mxys[0][1]
        txys = set((mxy[0] + dx, mxy[1] + dy) for mxy in mxys)
        if txys.issubset(nxys):
            print dx, dy
            break