#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
    int n;
    while(cin >> n, n) {
        vector<P> target(n);
        for(int i=0; i<n; ++i) {
            cin >> target[i].first >> target[i].second;
        }
        int m;
        cin >> m;
        map<P, bool> stars;
        for(int i=0; i<m; ++i) {
            int x, y;
            cin >> x >> y;
            stars[make_pair(x, y)] = true;
        }
        P now;
        for(auto& p : stars) {
            now = p.first;
            bool ok = true;
            for(int i=1; i<n; ++i) {
                now.first += target[i].first - target[i-1].first;
                now.second += target[i].second - target[i-1].second;
                ok &= stars.count(now) == 1;
            }
            if(ok) {
                cout << p.first.first - target[0].first << ' ' << p.first.second - target[0].second << endl;
                break;
            }
        }
    }
}
