#include <bits/stdc++.h>
using namespace std;
int m, n, x, y;
complex<int> c[200], s[1000];
int main() {
  while (cin >> m) {
    if (!m) return 0;
    int mx = 9999999, my = 9999999, M;
    for (int i = 0; i < m; i++) {
      cin >> x >> y;
      if (x < mx || x == mx && y < my) {
        mx = x;
        my = y;
        M = i;
      }
      c[i] = complex<int>(x, y);
    }
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> x >> y;
      s[i] = complex<int>(x, y);
    }
    for (int i = 0; i < n; i++) {
      complex<int> dif = s[i] - c[M];
      int f = 0;
      for (int j = 0; j < m; j++) {
        complex<int> t = c[j] + dif;
        int f2 = 0;
        for (int k = 0; k < n; k++) {
          if (s[k] == t) {
            f2 = 1;
            break;
          }
        }
        if (!f2) {
          f = 1;
          break;
        }
      }
      if (!f) {
        cout << dif.real() << endl << dif.imag() << endl;
        break;
      }
    }
  }
}
