#include <bits/stdc++.h>
#define range(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i, a) range(i, 0, a)
using namespace std;

int main() {
    int n;
    while(cin >> n, n) {
        vector <pair <int, int>> a(n);
        rep (i, n) cin >> a[i].first >> a[i].second;
        vector <pair <int, int>> relativeA;
        range (i, 1, n) {
            relativeA.emplace_back(a[i].first  - a[0].first,
                                   a[i].second - a[0].second);
        }
        int m;
        cin >> m;
        set <pair <int, int>> pos;
        rep (i, m) {
            int y, x;
            cin >> y >> x;
            pos.emplace(y, x);
        }

        for (auto & i : pos) {
            bool flag = true;

            for (auto & j : relativeA) {
                flag &= pos.count(make_pair(i.first + j.first, i.second + j.second));
            }

            if (flag) {
                cout << i.first - a[0].first << " " << i.second - a[0].second << endl;
                break;
            }
        }

    }
    return 0;
}
