#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr int INF = 2000000000;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
int main() {
  vector<int> findx, findy, starx, stary;
  int n, m;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    findx.emplace_back(a);
    findy.emplace_back(b);
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    starx.emplace_back(a);
    stary.emplace_back(b);
  }
  for (int i = 0; i < m; i++) {
    int sx = starx[i] - findx[0];
    int sy = stary[i] - findy[0];
    int count = 0;
    for (int j = 0; j < m; j++) {
      for (int k = 0; k < n; k++) {
        if (starx[j] - sx == findx[k] && stary[j] - sy == findy[k]) count++;
      }
    }
    if (count == n) {
      cout << sx << " " << sy << endl;
      break;
    }
  }
}
