#include<iostream>
#include<algorithm>
#include<set>
using namespace std;
set<pair<int, int> > S;
int main(){

    int m,n;
    while(cin>>m,m){
        int x[300],y[300];
        for(int i = 0;i < m;i++)cin>>x[i]>>y[i];
        cin>>n;
        int X[1100],Y[1100];
        for(int i = 0;i < n;i++)cin>>X[i]>>Y[i],S.insert(make_pair(X[i],Y[i]));

        for(int i = 0;i < n;i++){
            int dx = X[i] - x[0];
            int dy = Y[i] - y[0];
            bool flg = true;
            for(int j = 0;j < m;j++){
                int nx = x[j] + dx;
                int ny = y[j] + dy;
                if(nx < 0 || 1000000 < nx || ny < 0 || 1000000 < ny){
                    flg = false;
                    break;
                }
                set<pair<int, int> >::iterator it = S.find(make_pair(nx,ny));
                if(it == S.end()){
                    flg = false;
                    break;
                }
            }
            if(flg){
                cout<<dx<<" "<<dy<<endl;
                break;
            }
        }
    }

    return 0;
}