#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
template <class T>
using Table = vector<vector<T>>;
const ld eps = 1e-9;
int main() {
  while (1) {
    int M;
    cin >> M;
    if (!M) break;
    vector<pair<int, int>> constes;
    for (int i = 0; i < M; ++i) {
      int x, y;
      cin >> x >> y;
      constes.emplace_back(x, y);
    }
    int N;
    cin >> N;
    vector<pair<int, int>> stars;
    for (int i = 0; i < N; ++i) {
      int x, y;
      cin >> x >> y;
      stars.emplace_back(x, y);
    }
    sort(stars.begin(), stars.end());
    sort(constes.begin(), constes.end());
    for (int i = 0; i < M; ++i) {
      const int dx = stars[i].first - constes[0].first;
      const int dy = stars[i].second - constes[0].second;
      bool ok = true;
      for (int j = 0; j < M; ++j) {
        if (!binary_search(
                stars.begin(), stars.end(),
                make_pair(constes[j].first + dx, constes[j].second + dy)))
          ok = false;
      }
      if (ok) {
        cout << dx << " " << dy << endl;
        break;
      }
    }
  }
  return 0;
}
