#include <bits/stdc++.h>
using namespace std;
int main() {
  while (true) {
    int m, n;
    vector<pair<int, int> > ms, ns;
    scanf("%d", &m);
    if (m == 0) break;
    ms.resize(m);
    for (int i = 0; i < m; ++i) scanf("%d%d", &ms[i].first, &ms[i].second);
    scanf("%d", &n);
    ns.resize(n);
    for (int i = 0; i < n; ++i) scanf("%d%d", &ns[i].first, &ns[i].second);
    int dx, dy;
    for (int i = 0; i < n; ++i) {
      dx = ns[i].first - ms[0].first;
      dy = ns[i].second - ms[0].second;
      bool exist = true;
      for (int j = 0; j < m; ++j) {
        if (!binary_search(ns.begin(), ns.end(),
                           make_pair(ms[i].first + dx, ms[i].second + dy)))
          exist = false;
      }
      if (exist) break;
    }
    printf("%d\n%d\n", dx, dy);
  }
  return 0;
}
