#include "bits/stdc++.h"

using namespace std;
#define REP(i, s, n) for(signed i = (s); i < signed(n); i++)
#define rep(i, n) REP(i, 0, n)

typedef pair<int, int> P;

signed main() {
	int m, n;
	while (cin >> m && m) {
		vector<P> stars(m);
		rep(i, m) cin >> stars[i].first >> stars[i].second;

		cin >> n;
		vector<P> data(n);
		set<P> ss;
		rep(i, n) {
			int x, y; cin >> x >> y;
			P p = P(x, y);
			data[i] = p;
			ss.insert(p);
		}
		rep(i, n) {
			int dx = data[i].first - stars[0].first, dy = data[i].second - stars[0].second;
			bool ok = true;
			rep(j, m) {
				ok = ss.count(P(stars[j].first + dx, stars[j].second + dy));
				if (!ok) break;
			}

			if (ok) {
				cout << dx << " " << dy << endl;
				break;
			}
		}
	}

	return 0;
}