#include <bits/stdc++.h>
using namespace std;
int n, m, seizax[201], seizay[201], starx[201], stary[201], sax[201], say[201],
    ax, ay, z, cou;
bool ansx[1000001] = {false}, ansy[1000001] = {false};
int main() {
  for (;;) {
    cin >> n;
    if (n == 0) break;
    for (int i = 0; i < n; i++) {
      cin >> seizax[i] >> seizay[i];
    }
    for (int i = 1; i < n; i++) {
      sax[i - 1] = seizax[i] - seizax[0];
      say[i - 1] = seizay[i] - seizay[0];
    }
    cin >> m;
    for (int i = 0; i < m; i++) {
      cin >> starx[i] >> stary[i];
      ansx[starx[i]] = true;
      ansy[stary[i]] = true;
    }
    for (int i = 0; i < m; i++) {
      if (starx[i] + sax[0] >= 0 && starx[i] + sax[0] <= 1000000 &&
          stary[i] + say[0] >= 0 && stary[i] + say[0] <= 1000000) {
        if (ansx[starx[i] + sax[0]] && ansy[stary[i] + say[0]]) {
          for (int j = 1; j < n; j++) {
            if (starx[i] + sax[j] < 0 && starx[i] + sax[j] > 1000000 &&
                stary[i] + say[j] < 0 && stary[i] + say[j] > 1000000) {
              break;
            }
            if (ansx[starx[i] + sax[j]] == false ||
                ansy[stary[i] + say[j]] == false) {
              break;
            }
            if (cou == n - 2) {
              z = cou;
              ax = starx[i] - seizax[0];
              ay = stary[i] - seizay[0];
              break;
            }
            cou++;
          }
        }
      }
      if (z == n - 2) break;
    }
    cout << ax << " " << ay << endl;
  }
  return 0;
}
