#include <iostream>
#include <algorithm>
#define MOD 10000000
#define int long long
using namespace std;

signed main(){
	int m,mx[200],my[200],n,posn[1000];
	while(cin >> m,m){
	for(int i = 0;i < m;i++) {
		cin >> mx[i] >> my[i];
	}
	cin >> n;
	for(int i = 0;i < n;i++) {
		int x,y;
		cin >> x >> y;
		posn[i] = x * MOD + y;
	}
	sort(posn,posn + n);
	for(int i = 0;i < n;i++){
		bool flag = true;
		for(int j = 1;j < m;j++){
			int x = posn[i] / MOD + mx[j] - mx[0],y = posn[i] % MOD + my[j] - my[0];
			if(x >= 0 && x <= 1000000 && y >= 0 && y <= 1000000){
				int num = upper_bound(posn,posn + n,x * MOD + y) - lower_bound(posn,posn + n,x * MOD + y);
				if(num == 0) flag = false;
			}else flag = false;
		}
		if(flag){
			int nx = posn[i] / MOD,ny = posn[i] % MOD;
			cout << nx - mx[0] << " " << ny - my[0] << endl;
			break;
		}
	}
	}
	return 0;
}