#include<bits/stdc++.h>
using namespace std;

#define LLI long long int
LLI Xstar[1000005],Ystar[1000005],Xline[1000005],Yline[1000005],xx[1000005],yy[1000005];
LLI x,y,n,xans,yans,m,sum,j;

int main(){

    while(1){
        Xline[1000005]={0};
        Yline[1000005]={0};
    cin >> n;
    if(n==0)break;

    for(int i=0;i<n;i++){
        cin >> x >> y;
        Xstar[i]=x;
        Ystar[i]=y;
    }

    cin >> m;

    for(int i=0;i<m;i++){
        cin >> x >> y;
        xx[i]=x;
        yy[i]=y;
        Xline[x]=1;
        Yline[y]=1;
    }

    for(int i=0;i<m;i++){
            while(1){
            j++;
            if(j==n){
            xans=Xstar[0]-xx[i];
            yans=Ystar[0]-yy[i];
            break;
            }

            x=Xstar[0]-Xstar[j];
            y=Ystar[0]-Ystar[j];

            if(Xline[xx[i]-x]==1&&Yline[yy[i]-y]==1);
            else break;
        }
        if(j==n)break;
        else j=0;
    }

    cout << -xans << " " << -yans << endl;
    }

return 0;
}