#include <bits/stdc++.h>
using namespace std;
bool comp(const pair<int, int> &p1, const pair<int, int> &p2) {
  return p1.first < p2.first || (p1.first == p2.first && p1.second < p2.second);
}
bool C(pair<int, int> p1, pair<int, int> p2, int dx, int dy) {
  return (p1.first + dx < p2.first) ||
         (p1.first + dx == p2.first && p1.second + dy < p2.second);
}
int main() {
  pair<int, int> cel[1000], con[200];
  int m, n;
  int dx, dy;
  bool made;
  int ub, lb, mid;
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &con[i].first, &con[i].second);
  }
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &cel[i].first, &cel[i].second);
  }
  sort(cel, cel + n, comp);
  sort(con, con + m, comp);
  for (int i = 0; i < n; i++) {
    dx = cel[i].first - con[0].first;
    dy = cel[i].second - con[0].second;
    made = true;
    for (int j = 1; j < m; j++) {
      ub = n;
      lb = 0;
      while (ub - lb > 1) {
        mid = (ub + lb) / 2;
        if (C(con[j], cel[mid], dx, dy)) {
          ub = mid;
        } else {
          lb = mid;
        }
      }
      if (con[j].first + dx != cel[lb].first ||
          con[j].second + dy != cel[lb].second) {
        made = false;
        break;
      }
    }
    if (made) {
      printf("%d %d\n", dx, dy);
      break;
    }
  }
  return 0;
}
