#include <bits/stdc++.h>
using namespace std;
const int mod = 10000000;
int m, n, a, b;
int main() {
  while (cin >> m, m) {
    vector<long long> v(m);
    for (int i = 0; i < m; i++) {
      cin >> a >> b;
      v[i] = 1LL * a * mod + b;
    }
    set<int> s;
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> a >> b;
      s.insert(1LL * a * mod + b);
    }
    for (int i : s) {
      bool flag = true;
      for (int j = 1; j < v.size() && flag; j++) {
        if (s.find(v[j] - v[0] + i) == s.end()) flag = false;
      }
      if (flag)
        cout << i / mod - v[0] / mod << ' ' << i % mod - v[0] % mod << endl;
    }
  }
  return 0;
}
