#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() {
  m = 1;
  while (m != 0) {
    std::cin >> m;
    ll a, b;
    std::cin >> a >> b;
    ll x = a, y = b;
    for (int i = 1; i < m; i++) {
      ll tmp1, tmp2;
      std::cin >> tmp1 >> tmp2;
      tmp1 -= x;
      tmp2 -= y;
      x += tmp1;
      y += tmp2;
      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;
          coor next = one[0];
          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) {
              nowx = noww.x;
              nowy = noww.y;
              con = true;
              break;
            }
          }
        } else {
          break;
        }
      }
    }
    one.erase(one.begin(), one.end());
    two.erase(two.begin(), two.end());
    std::cout << ansx << " " << ansy << std::endl;
  }
  return 0;
}
