#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<utility>
#include<queue>
using namespace std;

int main() {

	for (int dd = 0; dd < 5; dd++) {
		int m;
		cin >> m;
		if (m == 0)break;
		else {
			int n, x, y, tar[210][2], sar[1010][2];//x,y
			bool cona = false, cons = false;

			for (int i = 0; i < m; i++) {
				int x1, y1;
				cin >> x1 >> y1;
				tar[i][0] = x1;
				tar[i][1] = y1;
			}
			cin >> n;
			for (int i = 0; i < n; i++) {
				int x2, y2;
				cin >> x2 >> y2;
				sar[i][0] = x2;
				sar[i][1] = y2;
			}

			for (int i = 0; i < n; i++) {//sarching star
				x = sar[i][0] - tar[0][0];//diside distance
				y = sar[i][1] - tar[0][1];
				for (int j = 1; j < m; j++) {//target star
					for (int k = 0; k < n; k++) {//sas[any]>(+x +y)>tas[j]?
						if (tar[j][0] + x == sar[k][0] && tar[j][1] + y == sar[k][1]) {
							cons = true;
							break;
						}
						else cons = false;
					}
					if (!cons)break;
					else if (j == m - 1) cona = true;
				}
				if (cona)break;
			}

			cout << x << " " << y << endl;
		}
	}
	return 0;
}

