#include <bits/stdc++.h>
using namespace std;
class Star {
 public:
  int x;
  int y;
  Star(int _x, int _y) : x(_x), y(_y){};
  bool operator>(const Star& p) const { return x > p.x; }
  bool operator==(const Star& p) const { return x == p.x; }
  inline bool operator<(const Star& p) const {
    return !(*this > p || *this == p);
  }
  inline bool operator>=(const Star& p) const {
    return *this > p || *this == p;
  }
  inline bool operator<=(const Star& p) const { return !(*this > p); }
  inline bool operator!=(const Star& p) const { return !(*this == p); }
};
int main() {
  string line;
  int m, n;
  vector<Star> constellation;
  vector<Star> stars;
  cin >> m;
  while (m != 0) {
    int i, j, k;
    int x, y;
    for (i = 0; i < m; ++i) {
      cin >> x >> y;
      Star star(x, y);
      constellation.push_back(star);
    }
    cin >> n;
    for (i = 0; i < n; ++i) {
      cin >> x >> y;
      Star star(x, y);
      stars.push_back(star);
    }
    sort(constellation.begin(), constellation.end());
    sort(stars.begin(), stars.end());
    bool notFound = true;
    for (i = 0; i < stars.size() && notFound; ++i) {
      int dx = stars[i].x - constellation[0].x;
      int dy = stars[i].y - constellation[0].y;
      k = 1;
      for (j = i; j < stars.size(); ++j) {
        if (stars[j].x == constellation[k].x + dx) {
          if (stars[j].y == constellation[k].y + dy) {
            k++;
            if (k == constellation.size()) {
              cout << dx << " " << dy << endl;
              notFound = false;
              break;
            }
          }
        } else if (stars[j].x > constellation[k].x + dx) {
          break;
        }
      }
    }
    cin >> m;
  }
  return 0;
}
