#include <bits/stdc++.h>

using namespace std;

#define REP(i,m) for(int i=0; i<m; i++)
#define FOR(i,n,m) for(int i=n; i<m; i++)
#define INF 1000000007
#define INFL (1LL << 60)
#define MOD 998244353
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define ll long long int
#define P pair<ll, ll>

int main(){
	while(true){
		int n;
		cin >> n;
		if(n == 0) break;
		int tx[n], ty[n];
		REP(i, n) cin >> tx[i] >> ty[i];
		int m;
		cin >> m;
		int sx[m], sy[m];
		REP(i, m) cin >> sx[i] >> sy[i];
		ll search[m];
		REP(i, m) search[i] = 10000000LL*sx[i]+sy[i];
		sort(search, search+m);
		int ax = -1, ay = -1;
		REP(i, m){
			int dx = sx[i]-tx[0], dy = sy[i]-ty[0];
			bool c = true;
			REP(j, n){
				int nx = tx[j] + dx, ny = ty[j] + dy;
				ll key = 10000000LL*nx+ny;
				if(!binary_search(search, search+m, key)){
					c = false;
				}
			}
			if(c){
				ax = dx; ay = dy;
			}
		}
		cout << ax << " " << ay << endl;
	}
	return 0;
} 
