#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
const double EPS = 1e-10;
const double PI = acos(-1.0);
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};
int main() {
  int m, n;
  while (cin >> m) {
    pair<int, int> field[m];
    for (int i = (0); i < (m); ++i) {
      int x, y;
      cin >> x >> y;
      field[i] = make_pair(x, y);
    }
    cin >> n;
    pair<int, int> star[n];
    for (int i = (0); i < (n); ++i) {
      int x, y;
      cin >> x >> y;
      star[i] = make_pair(x, y);
    }
    int x, y;
    for (int i = (0); i < (n); ++i) {
      x = star[i].first - field[0].first;
      y = star[i].second - field[0].second;
      int cnt = 0;
      for (int j = (0); j < (m); ++j) {
        for (int k = (0); k < (n); ++k) {
          if (field[j].first + x == star[k].first &&
              field[j].second + y == star[k].second)
            cnt++;
        }
      }
      if (cnt == m) break;
    }
    cout << x << ' ' << y << endl;
  }
}
