#include <bits/stdc++.h>
using ll = long long;
struct coor {
  ll x;
  ll y;
};
ll ansx, ansy;
ll m, n;
std::vector<coor> one, two;
int main() {
  std::cin >> m;
  ll a, b;
  std::cin >> a >> b;
  for (int i = 1; i < m; i++) {
    ll tmp1, tmp2;
    std::cin >> tmp1 >> tmp2;
    tmp1 -= a;
    tmp2 -= b;
    coor tmps = {tmp1, tmp2};
    one.push_back(tmps);
  }
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    ll tmp1, tmp2;
    std::cin >> tmp1 >> tmp2;
    coor tmps = {tmp1, tmp2};
    two.push_back(tmps);
  }
  for (int i = 0; i < n; i++) {
    ll nowx, nowy;
    coor now = two[i];
    nowx = now.x;
    nowy = now.y;
    bool con = true;
    for (int j = 0; j < m; j++) {
      if (j == m - 1) {
        coor ans = two[i];
        ansx = ans.x - a;
        ansy = ans.y - b;
        break;
      }
      coor next = one[j];
      if (con) {
        con = false;
        for (int k = 0; k < n; k++) {
          coor noww = two[k];
          if (nowx + next.x == noww.x && nowy + next.y == noww.y) {
            con = true;
            break;
          }
        }
      } else {
        break;
      }
    }
  }
  std::cout << ansx << " " << ansy << std::endl;
  return 0;
}
