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

int n, m;
vector<pair<int, int> > target;
set<pair<int, int> > stars;

bool containsAll(int dx, int dy) {
	for (int i = 0; i < m; i++) {
		pair<int, int>& p = target[i];
		if (stars.find(make_pair(p.first + dx, p.second + dy)) == stars.end()) {
			return false;
		}
	}
	return true;
}

void solve() {
	for (int i = 0; i < m; i++) {
		for (set<pair<int, int> >::iterator it = stars.begin(); it != stars.end(); ++it) {
			int dx = it->first - target[i].first;
			int dy = it->second - target[i].second;
			if (containsAll(dx, dy)) {
				cout << dx << ' ' << dy << endl;
				return;
			}
		}
	}
}

int main() {
	while (cin >> m, m) {
		target = vector<pair<int, int> >(m);
		for (int i = 0; i < m; i++) {
			int x, y;
			cin >> x >> y;
			target[i] = make_pair(x, y);
		}
		stars.clear();
		cin >> n;
		for (int i = 0; i < n; i++) {
			int x, y;
			cin >> x >> y;
			stars.insert(make_pair(x, y));
		}
		solve();
	}
}