#include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define ALL(a) (a).begin(),(a).end()
#define INF (1<<29)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
int main(){
      int n,m;
      while(cin>>n&&n){
            int x1[1000],y1[1000];
            int x2[1000],y2[1000];
            REP(i,n)cin>>x1[i]>>y1[i];
            cin>>m;
            set<P> f;
            int k;
            REP(i,m){
                  cin>>x2[i]>>y2[i];
                  f.insert(P(x2[i],y2[i]));
            }
            P ans;
            REP(i,m){
                  int xb=x2[i]-x1[0],yb=y2[i]-y1[0];
                  bool t=true;
                  for(int i=0;i<n;i++){
                        if(f.count(P(x1[i]+xb,y1[i]+yb))==0)t=false;
                  }
                  if(t)ans=P(xb,yb);
            }
            cout<<ans.first<<" "<<ans.second<<endl;
      }
}