#include <bits/stdc++.h>
using namespace std;
class Union_find {
 private:
  vector<int> par;
  vector<int> rank;
  int n;

 public:
  Union_find(int a) {
    n = a;
    for (int i = 0; i < n; i++) {
      par.push_back(i);
      rank.push_back(0);
    }
  }
  int find(int x) {
    if (par[x] == x) {
      return x;
    } else {
      return par[x] = find(par[x]);
    }
  }
  void unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return;
    if (rank[x] < rank[y]) {
      par[x] = y;
    } else {
      par[y] = x;
      if (rank[x] == rank[y]) rank[x]++;
    }
  }
  bool same(int x, int y) { return find(x) == find(y); }
};
struct edge {
  int to, cost;
};
int main(void) {
  int m;
  int tx[200], ty[200];
  int n;
  map<int, vector<int> > S;
  cin >> m;
  for (int i = 0; i < (m); i++) {
    cin >> tx[i] >> ty[i];
  }
  cin >> n;
  for (int i = 0; i < (n); i++) {
    int x, y;
    cin >> x >> y;
    S[x].push_back(y);
  }
  for (int i = 0; i < (1000000); i++) {
    for (int j = 0; j < (S[i].size()); j++) {
      bool flag;
      int diff_x, diff_y;
      diff_x = i - tx[0];
      diff_y = S[i][j] - ty[0];
      for (int k = (1); k < (m); k++) {
        flag = false;
        for (int l = 0; l < (S[tx[k] + diff_x].size()); l++) {
          if (S[tx[k] + diff_x][l] == ty[k] + diff_y) {
            flag = true;
          }
        }
        if (!flag) {
          break;
        }
      }
      if (flag) {
        cout << diff_x << " " << diff_y << endl;
        return 0;
      }
    }
  }
}
