#include <iostream>
#include <vector>
#include <algorithm>
#include <set>

using namespace std;

int main()
{
    int m;

    cin >> m;

    while(m!=0) {
        int n;
        int x,y;
        int dx,dy;
        set<pair<int,int> > target;
        set<pair<int,int> > stars;

        for(int i=0; i<m; ++i) {
            cin >> x >> y;
            target.insert({x,y});
        }

        cin >> n;

        for(int i=0; i<n; ++i) {
            cin >> x >> y;
            stars.insert({x,y});
        }

        for(set<pair<int,int> >::iterator itr_s=stars.begin(); itr_s!=stars.end(); ++itr_s) {
            int temp;
            set<pair<int,int> >::iterator itr_t=target.begin();
            dx=itr_s->first-itr_t->first; dy=itr_s->second-itr_t->second;
            ++itr_t;
            while(itr_t!=target.end()) {
                temp=stars.count({itr_t->first+dx,itr_t->second+dy});
                if(temp==0) break;
                ++itr_t;
            }
            if(temp==1) break;
        }

        cout << dx << " " << dy << endl;

        cin >> m;
    }
    return 0;
}