Problem: A country called Flatland is an infinite two-dimensional plane. Flatland has n cities, each of them is a point on the plane.

Flatland is ruled by king Circle IV. Circle IV has 9 sons. He wants to give each of his sons part of Flatland to rule. For that, he wants to draw four distinct straight lines, such that two of them are parallel to the Ox axis, and two others are parallel to the Oy axis. At that, no straight line can go through any city. Thus, Flatland will be divided into 9 parts, and each son will be given exactly one of these parts. Circle IV thought a little, evaluated his sons' obedience and decided that the i-th son should get the part of Flatland that has exactly ai cities.

Help Circle find such four straight lines that if we divide Flatland into 9 parts by these lines, the resulting parts can be given to the sons so that son number i got the part of Flatland which contains ai cities.

Input

The first line contains integer n (9 ≤ n ≤ 105) — the number of cities in Flatland. Next n lines each contain two space-separated integers: xi, yi ( - 109 ≤ xi, yi ≤ 109) — the coordinates of the i-th city. No two cities are located at the same point. The last line contains nine space-separated integers: <image>.

Output

If there is no solution, print a single integer -1.

Otherwise, print in the first line two distinct real space-separated numbers: x1, x2 — the abscissas of the straight lines that are parallel to the Oy axis. And in the second line print two distinct real space-separated numbers: y1, y2 — the ordinates of the straight lines, parallel to the Ox. If there are multiple solutions, print any of them. 

When the answer is being checked, a city is considered to lie on a straight line, if the distance between the city and the line doesn't exceed 10 - 6. Two straight lines are considered the same if the distance between them doesn't exceed 10 - 6.

Examples

Input

9
1 1
1 2
1 3
2 1
2 2
2 3
3 1
3 2
3 3
1 1 1 1 1 1 1 1 1


Output

1.5000000000 2.5000000000
1.5000000000 2.5000000000


Input

15
4 4
-1 -3
1 5
3 -4
-4 4
-1 1
3 -3
-4 -5
-3 3
3 2
4 1
-4 2
-2 -5
-3 4
-1 4
2 1 2 1 2 1 3 2 1


Output

-3.5000000000 2.0000000000
3.5000000000 -1.0000000000


Input

10
-2 10
6 0
-16 -6
-4 13
-4 -2
-17 -10
9 15
18 16
-5 2
10 -5
2 1 1 1 1 1 1 1 1


Output

-1

Note

The solution for the first sample test is shown below:

<image>

The solution for the second sample test is shown below:

<image>

There is no solution for the third sample test.

Solution (in CPP):

Solution:
#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;
  }
}