while True:

    m = int(eval(input()))

    if m == 0: break

    star = list({tuple(map(int, input().split())) for i in range(m)})

    sx, sy = star[0]

    

    n = int(eval(input()))

    starset = {tuple(map(int, input().split())) for i in range(n)}

    for x, y in starset:

        flag = True

        for j in range(len(star)-1):

            dx = x + star[j+1][0] - sx

            dy = y + star[j+1][1] - sy

            if (dx, dy) not in starset:

                flag = False

                break



        if flag == True:

            print((x - sx, y - sy))

            break

    



for e in iter(input,'0'):

    a=list({tuple(map(int, input().split())) for i in range(int(e))})

    s,t=a[0]

    b={tuple(map(int, input().split())) for i in range(int(eval(input())))}

    for x,y in b:

        flag = True

        for u,v in a[1:]:

            if (x + u - s, y + v - t) not in b:

                flag = False

                break



        if flag == True:

            print((x - s, y - t))

            break

while True:
    m = int(eval(input()))
    if m == 0:
        break
    star = list({tuple(map(int, input().split())) for i in range(m)})
    sx, sy = star[0]
    n = int(eval(input()))
    starset = {tuple(map(int, input().split())) for i in range(n)}
    for x, y in starset:
        flag = True
        for j in range(len(star) - 1):
            dx = x + star[j + 1][0] - sx
            dy = y + star[j + 1][1] - sy
            if (dx, dy) not in starset:
                flag = False
                break
        if flag == True:
            print((x - sx, y - sy))
            break

for e in iter(input, "0"):
    a = list({tuple(map(int, input().split())) for i in range(int(e))})
    s, t = a[0]
    b = {tuple(map(int, input().split())) for i in range(int(eval(input())))}
    for x, y in b:
        flag = True
        for u, v in a[1:]:
            if (x + u - s, y + v - t) not in b:
                flag = False
                break
        if flag == True:
            print((x - s, y - t))
            break

-while True: -    m = int(eval(input())) -    if m == 0: -        break -    star = list({tuple(map(int, input().split())) for i in range(m)}) -    sx, sy = star[0] -    n = int(eval(input())) -    starset = {tuple(map(int, input().split())) for i in range(n)} -    for x, y in starset: +for e in iter(input, "0"): +    a = list({tuple(map(int, input().split())) for i in range(int(e))}) +    s, t = a[0] +    b = {tuple(map(int, input().split())) for i in range(int(eval(input())))} +    for x, y in b: -        for j in range(len(star) - 1): -            dx = x + star[j + 1][0] - sx -            dy = y + star[j + 1][1] - sy -            if (dx, dy) not in starset: +        for u, v in a[1:]: +            if (x + u - s, y + v - t) not in b: -            print((x - sx, y - sy)) +            print((x - s, y - t))