#include <set>
#include <vector>
#include <iostream>
using namespace std;
typedef long long ll;
const int mod = 10000000;
int m, n, a, b;
int main() {
	while (cin >> m, m) {
		vector<ll> v(m);
		for (int i = 0; i < m; i++) {
			cin >> a >> b;
			v[i] = 1LL * a * mod + b;
		}
		set<ll> s;
		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> a >> b;
			s.insert(1LL * a * mod + b);
		}
		for (ll i : s) {
			bool flag = true;
			for (int j = 1; j < v.size() && flag; j++) {
				if (s.find(v[j] - v[0] + i) == s.end()) flag = false;
			}
			if (flag) cout << i / mod - v[0] / mod << ' ' << i % mod - v[0] % mod << endl;
		}
	}
	return 0;
}