#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<cmath>
#include<ctime>
#include<complex>

using namespace std;

#define REP(i,s,e) for(int i=int(s);i<=int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)


int main(){

	while(true){
		
		int m,n,x,y;
		vector<pair<int,int> >c;
		vector<pair<int,int> >p;
		vector<pair<int,int> >s;
		cin >> m;
		if(m==0) break;
		rep(i,m){
		cin >> x >> y;
		c.push_back(make_pair(x,y));
		}
		cin >> n;
		rep(i,n){
		cin >> x >> y;
		p.push_back(make_pair(x,y));
		}
		sort(c.begin(),c.end());
		sort(p.begin(),p.end());
		int x=0; int y;
        rep(i,n){
		rep(j,m-1){
	    s.push_back(make_pair(p[i].first+c[j+1].first-c[0].first,p[i].second+c[j+1].second-c[0].second));
		REP(k,i+1,n-1){
		if(p[k]==s[j]){ x++; break;}
		}
        }
		s.clear();
		if(x==m-1){ y=i; break;}
	}
		cout << p[y].first-c[0].first << " " << p[y].second-c[0].second << endl;
        c.clear(); p.clear();
	}

	return 0;
}