#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k;
  int m, n;
  int constel[200][2];
  int constel_margin[199][2];
  int stars[1000][2];
  int margin[2];
  int temp[0];
  cin >> m;
  while (m) {
    cin >> constel[0][0] >> constel[0][1];
    for (i = 1; i < m; i++) {
      cin >> constel[i][0] >> constel[i][1];
      constel_margin[i - 1][0] = constel[i][0] - constel[i - 1][0];
      constel_margin[i - 1][1] = constel[i][1] - constel[i - 1][1];
    }
    cin >> n;
    for (i = 0; i < n; i++) {
      cin >> stars[i][0] >> stars[i][1];
    }
    for (i = 0; i < n; i++) {
      k = 0;
      temp[0] = stars[i][0] + constel_margin[k][0];
      temp[1] = stars[i][1] + constel_margin[k][1];
      for (j = 0; j < n; j++) {
        if (stars[j][0] == temp[0] && stars[j][1] == temp[1]) {
          if (k == m - 2) {
            break;
          }
          k++;
          temp[0] = stars[j][0] + constel_margin[k][0];
          temp[1] = stars[j][1] + constel_margin[k][1];
          j = 0;
        }
      }
      if (k == m - 2) {
        break;
      }
    }
    cout << stars[i][0] - constel[0][0] << " ";
    cout << stars[i][1] - constel[0][1] << endl;
    cin >> m;
  }
}
