#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

typedef pair<int,int> P;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	while(true){
		int m,n; cin >> m;
		if(m == 0) break;
		vector<P> a(m);
		for (int i = 0;i < m;i++){
			cin >> a[i].first >> a[i].second;
		}
		sort(a.begin(),a.end());
		int x = a[0].first, y = a[0].second;
		for (int i = 0;i < m;i++){
			a[i] = P(a[i].first-x, a[i].second-y);
		}
		map<P,bool> mp;
		cin >> n;
		for (int i = 0;i < n;i++){
			int x,y; cin >> x >> y;
			mp[P(x,y)] = true;
		}

		bool f = false;
		
		for(auto&& i : mp){
			int idx = 0;
			int fx = i.first.first, fy = i.first.second;
			while(mp[P(a[idx].first+fx,a[idx].second+fy)]){
				if(idx == m-1){
					cout << fx - x << " " << fy - y << endl;
					f = true;
					break;
				}
				idx++;
			}
			if(f) break;
		}

	}

	return 0;

}

