#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;

int m, n;
std::vector<std::pair<int, int>>mxy, nxy;

int main()
{
	while (true)
	{
		m = n = 0;
		mxy.clear(); nxy.clear();

		in >> m;
		if (m == 0) { return 0; }
		rep(i, m)
		{
			int x, y;
			in >> x >> y;
			mxy.push_back({ x,y });
		}
		in >> n;
		rep(i, n)
		{
			int x, y;
			in >> x >> y;
			nxy.push_back({ x,y });
		}

		std::sort(nxy.begin(), nxy.end());
		std::sort(mxy.begin(), mxy.end());
		for (auto i : nxy)
		{
			auto dif_x = i.first - mxy[0].first;
			auto dif_y = i.second - mxy[0].second;
			bool flag = true;
			for (auto j : mxy)
			{
				auto iter = std::lower_bound(nxy.begin(), nxy.end(), std::make_pair(j.first + dif_x, j.second + dif_y));
				if (iter != nxy.end())
				{
					if (*iter != std::make_pair(j.first + dif_x, j.second + dif_y))
					{
						flag = false;
						break;
					}
				}
			}
			if (flag)
			{
				out << dif_x << " " << dif_y << std::endl;
				break;
			}
		}
	}
}