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

int main() {
	int m;
	while (cin >> m&&m != 0) {
		vector<int>fx, fy, px, py;
		int a, b;
		for (int i = 0; i < m; i++) {
			cin >> a >> b;
			fx.emplace_back(a);
			fy.emplace_back(b);
		}
		int n;
		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> a >> b;
			px.emplace_back(a);
			py.emplace_back(b);
		}
		for (int i = 0; i < n; i++) {
			int movex = px[i] - fx[0], movey = py[i] - fy[0];
			int count = 0;
			for (int j = 0; j < m; j++) {
				for (int o = 0; o < n; o++) {
					if (fx[j] + movex == px[o] && fy[j] + movey == py[o]) {
						count++;
					}
				}
			}
			if (count == m) {
				cout << movex << " " << movey << endl;
			}
		}
	}
}