#include <cstdio>
#include <iostream>
#include <algorithm>
#include <map>
#include <vector>
#define F first
#define S second
using namespace std;
typedef pair<int,int> P;
int m,n;
vector<P> st;
vector<P> sts;
map<P,int> mst;
int main(void)
{
  while(1){
    cin >> m;
    if(!m) break;

    st.clear();
    sts.clear();
    map<P,int> mc;
    mst = mc;

    int x,y;
    cin >> x >> y;
    st.push_back(P(0,0));
    for(int i = 1; i < m; i++){
      int a,b;
      cin >> a >> b;
      st.push_back(P(a-x,b-y));
    }
    cin >> n;
    for(int i = 0; i < n; i++){
      int a,b;
      cin >> a >> b;
      mst[P(a,b)] = 1;
      sts.push_back(P(a,b));
    }

    for(int i = 0; i < n; i++){
      bool f =true;
      int nx = sts[i].F;
      int ny = sts[i].S;
      for(int j = 0; j < m; j++){
	if(!mst[P(nx + st[j].F, ny + st[j].S)]){
	  f = false;
	  break;
	}
      }
      if(f){
	cout << nx - x << " " << ny - y << endl;
	break;;
      }
    }
  }
}