def f():
 for e in iter(input,'0'):
  a=[list(map(int,input().split()))for _ in[0]*int(e)]
  u,v=a[0]
  b=[tuple(map(int,input().split()))for _ in[0]*int(input())]
  for x,y in b:
   for s,t in a[1:]:
    if(x+s-u,y+t-v)not in b:return print(x-u,y-v)
f()
