#include <bits/stdc++.h>
using namespace std;
int main() {
  while (1) {
    int n, m, x, y, roop = 1, a[200][2], b[1000][2], star[10000][2];
    cin >> n;
    if (n == 0) {
      return 0;
    }
    for (int i = 0; i < n; i++) {
      cin >> a[i][0] >> a[i][1];
    }
    for (int i = 0; i < n - 1; i++) {
      star[i][0] = a[i + 1][0] - a[0][0];
      star[i][1] = a[i + 1][1] - a[0][1];
    }
    cin >> m;
    for (int i = 0; i < m; i++) {
      cin >> b[i][0] >> b[i][1];
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n - 1; j++) {
        for (int k = 0; k < m; k++) {
          if (b[k][0] == (b[i][0] + star[j][0]) &&
              b[k][1] == (b[i][1] + star[j][1])) {
            roop++;
            if (n == roop) {
              cout << b[i][0] - a[0][0] << ' ' << b[i][1] - a[0][1] << endl;
            }
          }
        }
      }
      roop = 1;
    }
  }
  return 0;
}
