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

int main()
{	
	int m, n;

	cin >> m;

	while (m > 0) {
		vector<pair <int, int>> p, q;

		for (int i = 0; i < m; i++) {
			int x, y;
			cin >> x >> y;
			p.push_back(make_pair(x, y));
		}

		cin >> n;

		for (int i = 0; i < n; i++) {
			int x, y;
			cin >> x >> y;
			q.push_back(make_pair(x, y));
		}

		int xp = p[0].first, yp = p[0].second;

		for (int i = 0; i < n; i++) {
			bool f = 1;
			int xf = q[i].first, yf = q[i].second;

			for (int j = 1; j < m; j++) {
				pair<int, int> pk = make_pair(p[j].first - xp + xf, p[j].second - yp + yf);
				if (find(q.begin(), q.end(), pk) == q.end()) {
					f = 0;
					break;
				}
			}

			if (f) {
				cout << xf - xp << " " << yf - yp << endl;
				break;
			}
		}

		cin >> m;
	}

	return 0;
}

