#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <set>
using namespace std;

int main()
{
	while (true) {
		vector<pair<int, int> > s;
		set<pair<int, int> > d;
		int m, n;
		cin >> n;
		if (n == 0) break;
		for (int i = 0; i < n; ++i) {
			int a, b; cin >> a >> b;
			s.push_back(make_pair(a, b));
		}
		cin >> m;
		for (int i = 0; i < m; ++i) {
			int a, b; cin >> a >> b;
			d.insert(make_pair(a, b));
		}
		sort(s.begin(), s.end());

		for (set<pair<int, int> >::iterator it = d.begin(); it != d.end(); ++it) {
			int dx = it->first - s[0].first;
			int dy = it->second - s[0].second;
			bool ok = true;
			for (int j = 1; j < n; ++j) {
				if (d.find(make_pair(s[j].first+dx, s[j].second+dy)) == d.end()) {
					ok = false;
					break;
				}
			}
			if (ok) { cout << dx << " " << dy << endl; break; }
		}
	}
	return 0;
}