#include <bits/stdc++.h>
using namespace std;
pair<int, int> d[300];
pair<int, int> dd[2000];
int main() {
  int m;
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    d[i] = make_pair(a, b);
  }
  int n;
  scanf("%d", &n);
  set<pair<int, int> > mp;
  for (int i = 0; i < n; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    dd[i] = make_pair(a, b);
    mp.insert(make_pair(a, b));
  }
  for (int i = 0; i < n; i++) {
    bool ok = true;
    pair<int, int> shift =
        make_pair(dd[i].first - d[0].first, dd[i].second - d[0].second);
    for (int j = 0; j < m; j++) {
      if (mp.end() == mp.find(make_pair(d[j].first + shift.first,
                                        d[j].second + shift.second))) {
        ok = false;
        break;
      }
    }
    if (ok) {
      printf("%d %d\n", shift.first, shift.second);
      break;
    }
  }
}
