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

 a=[list(map(int,input().split())) for _ in range(int(e))]

 s,t=a[0]

 b=[list(map(int,input().split())) for _ 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

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

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

 s,t=a[0]

 b={tuple(map(int,input().split())) for _ 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

for e in iter(input, "0"):
    a = [list(map(int, input().split())) for _ in range(int(e))]
    s, t = a[0]
    b = [list(map(int, input().split())) for _ 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

for e in iter(input, "0"):
    a = list(tuple(map(int, input().split())) for _ in range(int(e)))
    s, t = a[0]
    b = {tuple(map(int, input().split())) for _ 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

-    a = [list(map(int, input().split())) for _ in range(int(e))] +    a = list(tuple(map(int, input().split())) for _ in range(int(e))) -    b = [list(map(int, input().split())) for _ in range(int(eval(input())))] +    b = {tuple(map(int, input().split())) for _ in range(int(eval(input())))} -            if [x + u - s, y + v - t] not in b: +            if (x + u - s, y + v - t) not in b: