#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
int N, M;
set<long long int> star;
set<long long int> place;
long long int a, b;
long long int box;
bool flag;
int main() {
  cin >> M;
  while (M) {
    for (int i = 0; i < M; i++) {
      cin >> a >> b;
      star.insert(a * MOD + b);
    }
    cin >> N;
    for (int i = 0; i < N; i++) {
      cin >> a >> b;
      place.insert(a * MOD + b);
    }
    for (auto i : place) {
      box = i - *star.begin();
      flag = true;
      for (auto j : star) {
        if (place.find(j + box) == place.end()) {
          flag = false;
          break;
        }
      }
      if (flag) {
        cout << box / MOD << " " << box % MOD << endl;
        return 0;
      }
    }
    cin >> M;
  }
  return 0;
}
