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