#include <cstdio>
#include <set>

using namespace std;

typedef pair<int, int> P;
int X[1100], Y[1100];

int main()
{
	int m;
	set<P> st;
	while (scanf("%d", &m), m != 0){
		/*
		?????§m?????????x,y????????????
		?????§n?????????????????????????????????????????????
		*/
		P k[1001];
		int x[220], y[220];
		for (int i = 0; i < m; i++){
			scanf("%d %d", x + i, y + i);
		}
		for (int i = 1; i < m; i++){
			k[i] = P(x[i] - x[0], y[i] - y[0]);
		}
		
		int n;
		scanf("%d", &n);
		
		for (int i = 0; i < n; i++){
			scanf("%d %d", X + i, Y + i);
			st.insert(P(X[i], Y[i]));
		}
		
		int x_d = 1001001000, y_d = 1001001000;
		
		for (int i = 0; i < n ; i++){
			bool found = true;
			for (int j = 0; j < m; j++){
				if(!st.count(P(X[i] + k[j].first, Y[i] + k[j].second))) {
					found = false;
					break;
				}
			}
			if (found){
				x_d = X[i] - x[0];
				y_d = Y[i] - y[0];
			}
		}
		printf("%d %d\n", x_d, y_d);
	}
}