#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;
bool ansx[1000000] = {false}, ansy[1000000] = {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[0] - seizax[i];
      say[i - 1] = seizay[0] - seizay[i];
    }
    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 (ansx[starx[i] + sax[0]] && ansy[stary[i] + say[0]]) {
        for (int j = 1; j < n; j++) {
          if (!ansx[starx[i] + sax[i]] || !ansy[stary[i] + say[i]]) {
            break;
          }
          if (j == n - 1) {
            z = j;
            ax = seizax[0] - starx[i];
            ay = seizax[0] - stary[i];
            break;
          }
        }
      }
      if (z == n) break;
    }
    cout << ax << " " << ay << endl;
  }
}
