#include <bits/stdc++.h>
using namespace std;
map<pair<int, int>, bool> zahyo;
vector<pair<int, int> > vec;
int main() {
  int m;
  int x, y;
  int fx, fy;
  int nx, ny;
  cin >> m;
  cin >> x >> y;
  fx = x;
  fy = y;
  for (int i = 0; i < (m - 1); i++) {
    cin >> nx >> ny;
    vec.push_back(make_pair(nx - x, ny - y));
    x = nx;
    y = ny;
  }
  int n;
  cin >> n;
  for (int i = 0; i < (n); i++) {
    cin >> x >> y;
    zahyo.insert(make_pair(make_pair(x, y), true));
  }
  for (map<pair<int, int>, bool>::iterator it = zahyo.begin();
       it != zahyo.end(); it++) {
    int xx = (*it).first.first;
    int yy = (*it).first.second;
    int i;
    for (i = 0; i < vec.size(); i++) {
      xx += vec[i].first;
      yy += vec[i].second;
      if (zahyo.count(make_pair(xx, yy)) != 1) break;
    }
    if (i == vec.size()) {
      cout << (*it).first.first - fx << " " << (*it).first.second - fy << endl;
      break;
    }
  }
}
