#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<queue>
#include<set>
#include<map>

using namespace std;


int M, N;
int main() {
	while (cin >> M, M)
	{
		int sx[200], sy[200], skyx[1000], skyy[1000];
		set<pair<int, int>> ex;

		for (int i = 0; i < M; i++) {
			cin >> sx[i] >> sy[i];
		}

		cin >> N;
		for (int i = 0; i < N; i++) {
			cin >> skyx[i] >> skyy[i];

			ex.insert(make_pair(skyx[i], skyy[i]));
		}

		for (int i = 0; i < N; i++) {
			int dx = skyx[i] - sx[0];
			int dy = skyy[i] - sy[0];

			bool ok = false;
			for (int j = 0; j < M; j++) {
				if (ex.count(make_pair(sx[j] + dx, sy[j] + dy)) == 1) continue;

				ok = true;
				break;
			}

			if (ok) continue;

			cout << dx << " " << dy << endl;
		}
	}


	return 0;
}

