#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

struct Point {
	int x, y;
	Point(int x=0, int y=0) : x(x), y(y) {}
	bool operator<(const Point &o) const {
		return (x == o.x ? y < o.y : x < o.x);
	}
};

int main() {
	int m, n;
	while (cin >> m, m) {
		vector<Point> cons(m);
		vector<Point> diff(m);

		cin >> cons[0].x >> cons[0].y;
		diff[0].x = diff[0].y = 0;
		for (int i = 1; i < m; i++) {
			cin >> cons[i].x >> cons[i].y;
			diff[i].x = cons[i].x - cons[0].x;
			diff[i].y = cons[i].y - cons[0].y;
		}
		
		cin >> n;
		vector<Point> stars(n);
		for (int i = 0; i < n; i++) {
			cin >> stars[i].x >> stars[i].y;
		}
		sort(stars.begin(), stars.end());

		for (int i = 0; i < stars.size(); i++) {
			bool exist = true;
			for (int j = 0; j < m; j++) {
				if (binary_search(stars.begin(), stars.end(), Point(stars[i].x + diff[j].x, stars[i].y + diff[j].y))) {
					continue;
				} else {
					exist = false;
					break;
				}
			}
			if (exist) {
				cout << stars[i].x - cons[0].x << ' ' << stars[i].y - cons[0].y << endl;
				break;
			}
		}

	}
	return 0;
}