#include<iostream>
#include<vector>
#include<string>
#include<map>
using namespace std;

signed main() {
	int a;
	while (cin >> a, a) {
		int b[200][2]{};
		int c, d;
		cin >> c >> d;
		int l0= c, l1 = d;
		for (int e = 1; e < a; e++) {
			int f, g;
			cin >> f >> g;
			b[e][0] = f - c;
			b[e][1] = g - d;
			c = f; d = g;
		}
		int n;
		cin >> n;
		map<vector<int>, bool>h;
		for (int i = 0; i < n; i++) {
			vector<int>u(2);
			cin >> u[0] >> u[1];
			h[u] = true;
		}
		for (auto q = h.begin(); q != h.end(); q++) {
			int x = (*q).first[0]; int y = (*q).first[1];
			int r0 = x, r1 = y;
			for (int p = 0; p < a; p++) {
				x += b[p][0]; y += b[p][1];
				vector<int>t(2); t[0] = x; t[1] = y;
				if (h[t] == false)break;
				if (a - 1 == p) {
					cout <<r0-l0<<" "<<r1-l1 << endl;
					goto w;
				}
			}
		}
	w:;
	}
}