#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  while (cin >> m, m) {
    set<pair<int, int> > p;
    for (int i = 0; i < m; i++) {
      pair<int, int> t;
      cin >> t.first >> t.second;
      p.insert(t);
    }
    cin >> n;
    set<pair<int, int> > q;
    for (int i = 0; i < n; i++) {
      pair<int, int> t;
      cin >> t.first >> t.second;
      q.insert(t);
    }
    int ax = -1, ay = -1;
    for (auto const& e : q) {
      int dx = p.begin()->first - e.first;
      int dy = p.begin()->second - e.second;
      bool ok = true;
      for (auto const& f : p) {
        pair<int, int> t(f.first + dx, f.second + dy);
        if (q.count(t) == 0) {
          ok = false;
          break;
        }
      }
      if (ok) {
        ax = dx;
        ay = dy;
        break;
      }
    }
    cout << ax << " " << ay << endl;
  }
}
