#include <bits/stdc++.h>
using namespace std;
struct MyPoint {
  int32_t x, y;
};
class Kingdom {
  vector<vector<int32_t>> rmq;
  vector<vector<int32_t>> compressed_kingdom;
  vector<int32_t> sum_x;
  vector<int32_t> sum_y;
  vector<int32_t> compressed_x;
  vector<int32_t> compressed_y;
  void build(vector<vector<int32_t>> &points, int32_t v, int32_t tl,
             int32_t tr) {
    if (tl == tr)
      rmq[v] = points[tl];
    else {
      int32_t tm = (tl + tr) / 2;
      build(points, v * 2, tl, tm);
      build(points, v * 2 + 1, tm + 1, tr);
      merge(rmq[v * 2].begin(), rmq[v * 2].end(), rmq[v * 2 + 1].begin(),
            rmq[v * 2 + 1].end(), back_inserter(rmq[v]));
    }
  }
  int32_t query(int32_t v, int32_t tl, int32_t tr, int32_t l, int32_t r,
                int32_t y) {
    if (l > r) return 0;
    if (l == tl && tr == r) {
      auto pos = upper_bound(rmq[v].begin(), rmq[v].end(), y);
      auto result = distance(rmq[v].begin(), pos);
      return result;
    }
    int32_t tm = (tl + tr) / 2;
    return query(v * 2, tl, tm, l, min(r, tm), y) +
           query(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r, y);
  }

 public:
  Kingdom(vector<MyPoint> &points) {
    sum_x.resize(points.size() + 1, 0);
    sum_y.resize(points.size() + 1, 0);
    unordered_map<int32_t, int32_t> inverse_x;
    unordered_map<int32_t, int32_t> inverse_y;
    map<int32_t, int32_t> unique_sorted_x;
    map<int32_t, int32_t> unique_sorted_y;
    for (auto point : points) {
      unique_sorted_x[point.x]++;
      unique_sorted_y[point.y]++;
    }
    compressed_x.reserve(unique_sorted_x.size());
    compressed_y.reserve(unique_sorted_y.size());
    int32_t growing_x = 0;
    for (auto x : unique_sorted_x) {
      growing_x += x.second;
      inverse_x[x.first] = compressed_x.size();
      compressed_x.push_back(x.first);
      sum_x[growing_x] = compressed_x.size();
    }
    int32_t growing_y = 0;
    for (auto y : unique_sorted_y) {
      growing_y += y.second;
      inverse_y[y.first] = compressed_y.size();
      compressed_y.push_back(y.first);
      sum_y[growing_y] = compressed_y.size();
    }
    compressed_kingdom.resize(compressed_x.size(), vector<int32_t>());
    for (auto point : points) {
      compressed_kingdom[inverse_x[point.x]].push_back(inverse_y[point.y]);
    }
    for (vector<int32_t> &y_lines : compressed_kingdom) {
      sort(y_lines.begin(), y_lines.end());
    }
    rmq.resize(4 * compressed_kingdom.size());
    build(compressed_kingdom, 1, 0, compressed_kingdom.size() - 1);
  }
  pair<pair<int32_t, int32_t>, pair<int32_t, int32_t>> evaluate(
      vector<int32_t> &princes) {
    vector<int32_t> prince_pos{0, 1, 2, 3, 4, 5, 6, 7, 8};
    do {
      int32_t sum_column1 = princes[prince_pos[0]] + princes[prince_pos[1]] +
                            princes[prince_pos[2]];
      int32_t sum_column2 = princes[prince_pos[3]] + princes[prince_pos[4]] +
                            princes[prince_pos[5]];
      int32_t sum_column3 = princes[prince_pos[6]] + princes[prince_pos[7]] +
                            princes[prince_pos[8]];
      int32_t sum_row1 = princes[prince_pos[0]] + princes[prince_pos[3]] +
                         princes[prince_pos[6]];
      int32_t sum_row2 = princes[prince_pos[1]] + princes[prince_pos[4]] +
                         princes[prince_pos[7]];
      int32_t sum_row3 = princes[prince_pos[2]] + princes[prince_pos[5]] +
                         princes[prince_pos[8]];
      int32_t x1 = sum_x[sum_column1];
      int32_t x2 = sum_x[sum_column1 + sum_column2];
      int32_t x3 = sum_x[sum_column1 + sum_column2 + sum_column3];
      int32_t y1 = sum_y[sum_row1];
      int32_t y2 = sum_y[sum_row1 + sum_row2];
      int32_t y3 = sum_y[sum_row1 + sum_row2 + sum_row3];
      if (x1 > 0 && x2 > 0 && x3 > 0 && y1 > 0 && y2 > 0 && y3 > 0) {
        int32_t test_sum1 = princes[prince_pos[0]] + princes[prince_pos[1]];
        int32_t test_sum2 = princes[prince_pos[3]] + princes[prince_pos[4]];
        int32_t test_sum3 = princes[prince_pos[6]] + princes[prince_pos[7]];
        int32_t test_sum4 = princes[prince_pos[0]];
        int32_t test_sum5 = princes[prince_pos[3]];
        int32_t test_sum6 = princes[prince_pos[6]];
        int32_t result1 =
            query(1, 0, compressed_kingdom.size() - 1, 0, x1 - 1, y2 - 1);
        if (test_sum1 != result1) continue;
        int32_t result2 =
            query(1, 0, compressed_kingdom.size() - 1, x1, x2 - 1, y2 - 1);
        if (test_sum2 != result2) continue;
        int32_t result3 = query(1, 0, compressed_kingdom.size() - 1, x2,
                                compressed_kingdom.size() - 1, y2 - 1);
        if (test_sum3 != result3) continue;
        int32_t result4 =
            query(1, 0, compressed_kingdom.size() - 1, 0, x1 - 1, y1 - 1);
        if (test_sum4 != result4) continue;
        int32_t result5 =
            query(1, 0, compressed_kingdom.size() - 1, x1, x2 - 1, y1 - 1);
        if (test_sum5 != result5) continue;
        int32_t result6 = query(1, 0, compressed_kingdom.size() - 1, x2,
                                compressed_kingdom.size() - 1, y1 - 1);
        if (test_sum6 != result6) continue;
        return make_pair(make_pair(compressed_x[x1 - 1], compressed_x[x2 - 1]),
                         make_pair(compressed_y[y1 - 1], compressed_y[y2 - 1]));
      }
    } while (next_permutation(prince_pos.begin(), prince_pos.end()));
    return make_pair(make_pair(0, 0), make_pair(0, 0));
  };
};
int main() {
  ios::sync_with_stdio(0);
  int32_t n;
  cin >> n;
  vector<MyPoint> points;
  points.reserve(n);
  for (int i = 0; i < n; i++) {
    int32_t x, y;
    cin >> x >> y;
    points.push_back({x, y});
  }
  vector<int32_t> princes;
  for (int i = 0; i < 9; i++) {
    int32_t w;
    cin >> w;
    princes.push_back(w);
  }
  Kingdom kingdom(points);
  auto result = kingdom.evaluate(princes);
  if (result.first.first == 0 && result.first.second == 0 &&
      result.second.first == 0 && result.second.second == 0) {
    cout << -1 << endl;
  } else {
    cout << fixed << 0.5 + result.first.first << " " << fixed
         << 0.5 + result.first.second << endl;
    cout << fixed << 0.5 + result.second.first << " " << fixed
         << 0.5 + result.second.second << endl;
  }
}
