#include <bits/stdc++.h>
using namespace std;
template <class T>
bool find(vector<T> v, T key) {
  for (size_t i = 0; i < v.size(); i++)
    if (v[i] == key) return true;
  return false;
}
int main() {
  int m;
  while (cin >> m, m) {
    pair<int, int> st;
    cin >> st.first >> st.second;
    vector<pair<int, int>> c;
    for (int i = 1; i < m; i++) {
      int q, w;
      cin >> q >> w;
      c.push_back(make_pair(q, w));
    }
    vector<pair<int, int>> stars;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
      int a, b;
      cin >> a >> b;
      stars.push_back(make_pair(a, b));
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m - 1; j++) {
        if (find(stars, make_pair(stars[i].first + c[i].first,
                                  stars[i].second + c[i].second)))
          ;
        else
          goto end;
      }
      cout << stars[i].first - st.first << ' ' << stars[i].second - st.second
           << endl;
      goto trueend;
    end:;
    }
  trueend:;
  }
  return 0;
}
