#include <bits/stdc++.h>
using namespace std;
struct pos {
  int x, y;
};
map<int, map<int, int>> smap;
int index(int x, int y) {
  auto i0 = smap.find(x);
  if (i0 == smap.end()) return -1;
  auto i1 = i0->second.find(y);
  if (i1 == i0->second.end()) return -1;
  return i1->second;
}
int main() {
  while (true) {
    int m, n;
    cin >> m;
    if (m == 0) break;
    vector<pos> star(m);
    for (int i = 0; i < m; i++) {
      cin >> star[i].x >> star[i].y;
    }
    cin >> n;
    vector<pos> sky(n);
    for (int i = 0; i < n; i++) {
      cin >> sky[i].x >> sky[i].y;
      smap[sky[i].x][sky[i].y] = i;
    }
    for (int i = 0; i < n; i++) {
      int dx = sky[i].x - star[0].x;
      int dy = sky[i].y - star[0].y;
      bool same = true;
      for (int j = 0; j < m; j++) {
        int id = index(star[j].x + dx, star[j].y + dy);
        if (id < 0) {
          same = false;
          break;
        }
      }
      if (same) {
        cout << dx << "," << dy << endl;
        break;
      }
    }
  }
  return 0;
}
