#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <utility>
#include <map>

using namespace std;

typedef pair<int, int> P;

int main() {
	int m, n;
	
	while (cin >> m && m != 0) {
		P p[200], s[1000];
		map<P, bool> mp;

		for (int i = 0; i < m; ++i) {
			cin >> p[i].first >> p[i].second;
		}
		cin >> n;
		for (int i = 0; i < n; ++i) {
			cin >> s[i].first >> s[i].second;
			mp[s[i]] = true;
		}

		//O(nmlogn)
		for (int j = 0; j < n; ++j) { //j???????????????
			int dx = s[j].first - p[0].first;
			int dy = s[j].second - p[0].second;
			bool success = true;
			for (int k = 0; k < m; ++k) { //??????k????????¨?????????
				if (mp[make_pair(p[k].first + dx, p[k].second + dy)] != true) {
					success = false;
					break;
				}
			}
			if (success) {
				cout << dx << " " << dy << endl;
				break;
			}
		}
	}

	return 0;
}