#include <cstdio>
#include <map>
#include <vector>
#define fi first
#define sec second
using namespace std;
typedef pair<int,int> P;

int m, n;

int main(){
	while(scanf("%d", &m),m){
		if(m == 1){
			int a,b,c,d;
			scanf("%d%d%d%d%d",&a,&b,&n,&c,&d);
			printf("%d %d\n", c-a, d-b);
			continue;
		}
		map<P,bool> ma;
		map<P,bool>::iterator it;
		vector<P> v;
		P s;
		for(int i = 0; i < m; i++){
			int x, y;
			scanf("%d%d", &x, &y);
			if(i == 0){
				s.fi = x;
				s.sec = y;
			} else{
				x -= s.fi; y -= s.sec;
				v.push_back(P(x,y));
			}
		}
		scanf("%d", &n);
		for(int i = 0; i < n; i++){
			int x, y;
			scanf("%d%d", &x, &y);
			ma[P(x,y)] = 1;
		}
		for(it = ma.begin(); it != ma.end(); it++){
			P p = it->fi;
			bool ok = true;
			for(int i = 0; i < m-1; i++){
				if(ma.count(P(p.fi+v[i].fi,p.sec+v[i].sec)) == 0){
					ok = false;
					break;
				}
			}
			if(ok){
				printf("%d %d\n", p.fi-s.fi, p.sec-s.sec);
				break;
			}
		}
	}
}