#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <bitset>
#include <fstream>
#include <cmath>
#include <ctime>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> Pair_i;

int main()
{
	int n, m;

	while(cin>> m && m){
		vector<Pair_i> target(m);
		for(int i = 0; i < m; i++)	cin >> target[i].first >> target[i].second;

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

		sort(night.begin(), night.end());
		sort(target.begin(), target.end());

		for(int i = 0; i < n; i++){
			bool flag = false;
			Pair_i d = make_pair(target[0].first - night[i].first, target[0].second - night[i].second);

			for(int j = 1; j < m; j++){
				if(!binary_search(night.begin(), night.end(), make_pair(target[j].first - d.first, target[j].second - d.second))) break;
				else if(j == m-1){
					cout<<-d.first<<" "<<-d.second<<endl;;
					flag = true;
					break;
				}
			}
			if(flag) break;
		}
	}
}