#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int m, n;
  while (cin >> m) {
    int sx[m], sy[m];
    for (int i = 0; i < m; i++) cin >> sx[i] >> sy[i];
    cin >> n;
    int cx[n], cy[n];
    for (int i = 0; i < n; i++) cin >> cx[i] >> cy[i];
    set<pair<int, int> > st;
    for (int i = 0; i < n; i++) st.insert(pair<int, int>(cx[i], cy[i]));
    for (int i = 0; i < n; i++) {
      int dx = cx[i] - sx[0], dy = cy[i] - sy[0];
      bool flg = false;
      for (int j = 0; j < m; j++) {
        if (st.count(pair<int, int>(sx[j] + dx, sy[j] + dy))) {
          continue;
        }
        flg = true;
        break;
      }
      if (flg) {
        continue;
      }
      cout << dx << ' ' << dy << endl;
      break;
    }
  }
  return 0;
}
