#include <iostream>
#include <cstdio>
#include <vector>
#include <set>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

#define MP make_pair
#define PB push_back

typedef pair<int, int> PII;

int main() {
	int m, n;
	bool flag;

	while (1) {
		vector<PII> seiza;
		set<PII> star;

		cin >> m;
		if (m == 0) break;
		REP(i, m) {
			int x, y;
			scanf("%d %d", &x, &y);
			seiza.PB(MP(x, y));
		}
		cin >> n;
		REP(i, n) {
			int x, y;
			scanf("%d %d", &x, &y);
			star.insert(MP(x, y));
		}


		for (set<PII>::iterator it = star.begin(); it != star.end(); it++) {
			PII target = *(it);
			int dx = target.first - seiza[0].first;
			int dy = target.second - seiza[0].second;

			flag = true;
			REP(j, m) {
				if (star.find(MP(seiza[j].first + dx, seiza[j].second + dy)) == star.end())
					flag = false;
			}
			if (flag) {
				printf("%d %d\n", dx, dy);
				break;
			}
		}
	}
	return 0;
}