#include<iostream>
#include<vector>
#include<set>
#include<algorithm>
using namespace std;
typedef pair<int, int>P;

int main() {
	int m;
	while (cin >> m, m) {
		vector<P>v;
		set<P>s;
		for (int i = 0;i < m;i++) {
			int a, b;
			cin >> a >> b;
			v.push_back(make_pair(a, b));
		}
		int n;
		cin >> n;
		for (int i = 0;i < n;i++) {
			int a, b;
			cin >> a >> b;
			s.insert(make_pair(a, b));
		}

		sort(v.begin(), v.end());
		P ans = make_pair(0, 0);

		for (auto itr = s.begin();itr != s.end();itr++) {
			P dif;
			dif.first = (*itr).first - v[0].first;
			dif.second = (*itr).second - v[0].second;
			int c = 1;
			for (int i = 1;i < m;i++) {
				P a = make_pair(v[i].first + dif.first, v[i].second + dif.second);
				auto it = s.find(a);
				if (it != s.end())c++;
			}
			ans = dif;
			if (c == m)break;
		}
		cout << ans.first << ' ' << ans.second << endl;
	}
	return 0;
}