#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)

int cx[210],cy[210];
int sx[1010],sy[1010];
set<pair<int,int>> s;

int main(void){
	int m,n;
	while(cin >> m,m){
		s.clear();
		rep(i,m) cin >> cx[i] >> cy[i];
		cin >> n;
		rep(i,n) cin >> sx[i] >> sy[i];
		rep(i,n) s.insert(make_pair(sx[i],sy[i]));

		int ax=-1,ay=-1;
		rep(i,m)rep(j,n){
			int dx=sx[j]-cx[i],dy=sy[j]-cy[i];
			bool ok=true;
			rep(k,m){
				if(s.find(make_pair(cx[k]+dx,cy[k]+dy))==s.end()){
					ok=false;
					break;
				}
			}
			if(ok) ax=dx,ay=dy;
		}
		cout << ax << " " << ay <<  endl;
	}
}