#include <cstdio>
#include <vector>
#include <set>
typedef unsigned long long ull;
using namespace std;
struct Point {
	int x,y;
	Point(int _x,int _y) {x=_x,y=_y;}
};
set<ull> S;
vector<Point> A,B;
int main() {
	int m,n;
	int X,Y;
	while(scanf("%d",&m),m) {
		S.clear();
		A.clear();
		B.clear();
		scanf("%d %d",&X,&Y);
		A.push_back(Point(0,0));
		for(int i=0;i<m-1;i++) {
			int x,y;
			scanf("%d %d",&x,&y);
			A.push_back(Point(x-X,y-Y));
		}
		scanf("%d",&n);
		for(int i=0;i<n;i++) {
			int x,y;
			scanf("%d %d",&x,&y);
			B.push_back(Point(x,y));
			S.insert((ull)x*1000000+y);
		}
		for(int i=0;i<n;i++) {
			bool OK=true;
			for(int j=0;j<m;j++) {
				int x=B[i].x+A[j].x,y=B[i].y+A[j].y;
				if(0>x||0>y) {OK=false; break;}
				if(S.find((ull)x*1000000+y)==S.end()) {OK=false; break;}
			}
			if(OK) {printf("%d %d\n",B[i].x-X,B[i].y-Y); break;}
		}
	}
}