#include <iostream>
#include <cstdio>

using namespace std;

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

int n[2];
int star[2][2][1000];
bool flag;

bool serach(int x, int y) {
	REP(i, n[1]) {
		if (x == star[1][0][i] && y == star[1][1][i]) {
			return true;
		}
	}
	return false;
}

int main() {
	while (1) {
		cin >> n[0];
		if (n[0] == 0) break;
		REP(i, n[0]) scanf("%d %d", &star[0][0][i], &star[0][1][i]);
		cin >> n[1];
		REP(i, n[1]) scanf("%d %d", &star[1][0][i], &star[1][1][i]);

		//star [0:??? 1:?????¨][0:x 1:y][i]
		REP(i, n[1]) {
			int dx = star[1][0][i] - star[0][0][0];
			int dy = star[1][1][i] - star[0][1][0];

			flag = true;
			REP(j, n[0]) {
				if (!serach(star[0][0][j] + dx, star[0][1][j] + dy))
					flag = false;
			}
			if (flag) {
				printf("%d %d\n", dx, dy);
				break;
			}
		}
	}
	return 0;
}