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

int m, n;
pair<int, int> sample[200], star[1000];
int main()
{
  while(cin >> m && m){
    for(int i = 0; i < m; i++)
      cin >> sample[i].first >> sample[i].second;

    cin >> n;
    for(int i = 0; i < n; i++)
      cin >> star[i].first >> star[i].second;

    sort(sample, sample + m);
    sort(star, star + n);

    for(int i = 0; i < n; i++){
      pair<int, int> vec = make_pair(star[i].first - sample[0].first, star[i].second - sample[0].second);
      int searching = 0;
      pair<int, int> target = make_pair(sample[0].first + vec.first, sample[0].second + vec.second);
      bool flag = false;
      for(int j = 0; j < n; j++){
	if(target == star[j]){
	  searching++;
	  if(searching == m){
	    flag = true;
	    break;
	  }
	  target = make_pair(sample[searching].first + vec.first, sample[searching].second + vec.second);
	}
	if(target < star[j])
	  break;
      }
      if(flag){
	cout << vec.first << " " << vec.second << endl;
	break;
      }
    }
  }
  return 0;
}