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(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:

  f=1

  for u,v in a[1:]:

   if(x+u-s,y+v-t)not in b:f=0;break

  if f: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(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:
        f = 1
        for u, v in a[1:]:
            if (x + u - s, y + v - t) not in b:
                f = 0
                break
        if f:
            print((x - s, y - t))
            break

-    b = [tuple(map(int, input().split())) for _ in range(int(eval(input())))] +    b = {tuple(map(int, input().split())) for _ in range(int(eval(input())))} -        flag = True +        f = 1 -                flag = False +                f = 0 -        if flag == True: +        if f: