#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
while(true) {
int m, n;
vector<pair<int, int> > ms, ns;

scanf("%d", &m);
if(m == 0)
break;
ms.resize(m);
for(int i = 0; i < m; ++i)
scanf("%d%d", &ms[i].first, &ms[i].second);
scanf("%d", &n);
ns.resize(n);
for(int i = 0; i < n; ++i)
scanf("%d%d", &ns[i].first, &ns[i].second);
sort(ms.begin(), ms.end());
sort(ns.begin(), ns.end());
int dx, dy;
for(int i = 0; i < n; ++i) {
dx = ns[i].first - ms[0].first;
dy = ns[i].second - ms[0].second;
bool exist = true;
for(int j = 0; j < m; ++j) {
if(!binary_search(ns.begin(), ns.end(), make_pair(ms[j].first + dx, ms[j].second + dy)))
exist = false;
}
if(exist)
break;
}
printf("%d %d\n", dx, dy);
}
return 0;
}