#include <bits/stdc++.h>
using namespace std;
const long long hmod1 = 999999937;
const long long hmod2 = 1000000000 + 9;
const long long INF = 1 << 30;
const long long mod = 10000;
const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};
const int dx8[8] = {1, 1, 1, 0, 0, -1, -1, -1};
const int dy8[8] = {0, 1, -1, 1, -1, 0, 1, -1};
const double pi = 3.141592653589793;
long long m, n;
long long x1[205], yy1[205], x2[1005], y2[1005];
vector<pair<long long, long long>> v;
map<pair<long long, long long>, long long> mp;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> m;
  long long sx = -1, sy = -1;
  cin >> sx >> sy;
  for (long long i = 0; i < (m - 1); i++) {
    cin >> x1[i] >> yy1[i];
    v.push_back({x1[i] - sx, yy1[i] - sy});
  }
  cin >> n;
  for (long long i = 0; i < (n); i++) {
    cin >> x2[i] >> y2[i];
    mp[{x2[i], y2[i]}] = 1;
  }
  for (long long i = 0; i < (n); i++) {
    long long bx = x2[i];
    long long by = y2[i];
    long long cnt = 0;
    for (long long j = 0; j < (m - 1); j++) {
      long long x = v[i].first, y = v[i].second;
      if (mp[{bx + x, by + y}]) cnt++;
    }
    if (cnt == m - 1) {
      cout << bx - sx << " " << by - sy << endl;
      break;
    }
  }
}
