#include <bits/stdc++.h>
using namespace std;
int main() {
  int m = 0;
  int n = 0;
  int x[200];
  int y[200];
  int xx[1000];
  int yy[1000];
  int xa[200];
  int ya[200];
  int s[2];
  int i = 0;
  int j = 0;
  int k = 0;
  int e = 0;
  cin >> m;
  for (i = 0; i < 200; i++) {
    x[i] = 0;
    y[i] = 0;
    xa[i] = 0;
    ya[i] = 0;
  }
  for (i = 0; i < 1000; i++) {
    xx[i] = 0;
    yy[i] = 0;
  }
  for (i = 0; i < m; i++) {
    cin >> x[i];
    cin >> y[i];
  }
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> xx[i];
    cin >> yy[i];
  }
  for (i = 0; i < m - 1; i++) {
    xa[i] = x[i + 1] - x[0];
    ya[i] = y[i + 1] - y[0];
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < m - 1; j++) {
      for (k = 0; k < n; k++) {
        if (xx[i] + xa[j] == xx[k] && yy[i] + ya[j] == yy[k]) {
          e++;
          break;
        }
      }
    }
    if (e == m - 1) {
      break;
    }
    e = 0;
  }
  s[0] = xx[i] - x[0];
  s[1] = yy[i] - y[0];
  cout << s[0] << " " << s[1] << endl;
}
