#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n, x, y, i;
  pair<int, int> a[200], b[1000];
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &x, &y);
    a[i] = pair<int, int>(x, y);
  }
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &x, &y);
    b[i] = pair<int, int>(x, y);
  }
  sort(a, a + m);
  sort(b, b + n);
  for (int i = 1; i < m; i++)
    a[i] = pair<int, int>(a[i].first - a[0].first, a[i].second - a[0].second);
  for (i = 0; i < n; i++) {
    bool flag = true;
    for (int j = 1; j < m; j++) {
      if (!binary_search(b, b + n,
                         pair<int, int>(b[i].first + a[j].first,
                                        b[i].second + a[j].second)))
        flag = false;
    }
    if (flag) break;
  }
  printf("%d %d\n", b[i].first - a[0].first, b[i].second - a[0].second);
  return 0;
}
