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;
inline int Get() {
  int res = 0, q = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') q = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') res = res * 10 + ch - '0', ch = getchar();
  return res * q;
}
const double eps = 1e-12, pi = M_PI;
const int oo = (int)2e9, mod = (int)1e9 + 7;
const long long INF = (long long)1e17;
const int N = (int)1e5;
typedef int arr[N + 10];
arr a, b, c, lstx, lsty, id, u, v, sc;
bool vs[10];
int d[10], ord[10];
int n, m;
bool cmp_x(const int &x, const int &y) { return a[x] < a[y]; }
bool cmp_y(const int &x, const int &y) { return b[x] < b[y]; }
struct node {
  node *ch[2];
  int s;
} * Rt[N + 10];
node *New() {
  node *res = new node;
  res->ch[0] = res->ch[1] = NULL, res->s = 0;
  return res;
}
node *Copy(node *x) {
  node *res = new node;
  res->ch[0] = x->ch[0], res->ch[1] = x->ch[1], res->s = x->s;
  return res;
}
node *New(node *x, int d) {
  if (!x->ch[d]) return New();
  return Copy(x->ch[d]);
}
void Update(node *x) {
  x->s = 0;
  if (x->ch[0]) x->s += x->ch[0]->s;
  if (x->ch[1]) x->s += x->ch[1]->s;
}
void Add(int l, int r, node *&x, int pos) {
  if (l == r) {
    ++x->s;
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid)
    Add(l, mid, x->ch[0] = New(x, 0), pos);
  else
    Add(mid + 1, r, x->ch[1] = New(x, 1), pos);
  Update(x);
}
int Query(int l, int r, node *x, int ml, int mr) {
  if (!x || ml > mr) return 0;
  if (l >= ml && r <= mr) return x->s;
  int mid = (l + r) >> 1, res = 0;
  if (ml <= mid) res += Query(l, mid, x->ch[0], ml, mr);
  if (mr > mid) res += Query(mid + 1, r, x->ch[1], ml, mr);
  return res;
}
void Init() {
  scanf(
      "%d"
      "\n",
      &n);
  for (int i = (1), end = (n); i <= end; ++i)
    scanf(
        "%d"
        "%d"
        "\n",
        a + i, b + i),
        u[i] = a[i], v[i] = b[i], c[i] = a[i], lstx[i] = i, lsty[i] = i;
  for (int i = (1), end = (9); i <= end; ++i) scanf("%d", d + i);
  c[n + 1] = oo;
  sort(c + 1, c + n + 1);
  int cnt = 0;
  for (int i = (1), end = (n); i <= end; ++i)
    if (c[i] != c[i + 1]) c[++cnt] = c[i];
  for (int i = (1), end = (n); i <= end; ++i)
    a[i] = lower_bound(c + 1, c + cnt + 1, a[i]) - c;
  for (int i = (1), end = (n); i <= end; ++i) c[i] = b[i];
  sort(c + 1, c + n + 1);
  cnt = 0;
  for (int i = (1), end = (n); i <= end; ++i)
    if (c[i] != c[i + 1]) c[++cnt] = c[i];
  m = cnt;
  for (int i = (1), end = (n); i <= end; ++i)
    b[i] = lower_bound(c + 1, c + cnt + 1, b[i]) - c;
  sort(lstx + 1, lstx + n + 1, cmp_x);
  sort(lsty + 1, lsty + n + 1, cmp_y);
  Rt[0] = New();
  int tot = 0;
  for (int i = (1), end = (n); i <= end; ++i) {
    int x = lstx[i];
    if (a[x] == a[lstx[i - 1]])
      Rt[i] = Rt[sc[tot]], id[x] = tot;
    else
      Rt[i] = Copy(Rt[sc[tot]]), sc[++tot] = i, id[x] = tot;
    Add(1, m, Rt[i], b[x]);
  }
}
void Check() {
  int x1 = lstx[ord[1] + ord[4] + ord[7]],
      x2 = lstx[ord[1] + ord[2] + ord[4] + ord[5] + ord[7] + ord[8] + 1];
  int y1 = lsty[ord[7] + ord[8] + ord[9]],
      y2 = lsty[ord[7] + ord[8] + ord[9] + ord[4] + ord[5] + ord[6] + 1];
  int num = Query(1, m, Rt[sc[id[x1]]], b[y2], m);
  if (num != ord[1]) return;
  num = Query(1, m, Rt[sc[id[x1]]], b[y1] + 1, b[y2] - 1);
  if (num != ord[4]) return;
  num = Query(1, m, Rt[sc[id[x1]]], 1, b[y1]);
  if (num != ord[7]) return;
  num = Query(1, m, Rt[sc[id[x2] - 1]], b[y2], m) - ord[1];
  if (num != ord[2]) return;
  num = Query(1, m, Rt[sc[id[x2] - 1]], 1, b[y1]) - ord[7];
  if (num != ord[8]) return;
  num = Query(1, m, Rt[n], b[y2], m) - ord[1] - ord[2];
  if (num != ord[3]) return;
  num = Query(1, m, Rt[n], 1, b[y1]) - ord[7] - ord[8];
  if (num != ord[9]) return;
  num = Query(1, m, Rt[n], b[y1] + 1, b[y2] - 1) -
        Query(1, m, Rt[sc[id[x2] - 1]], b[y1] + 1, b[y2] - 1);
  if (num != ord[6]) return;
  double px1 = (double)u[x1] + 0.5, px2 = (double)u[x2] - 0.5;
  double py1 = (double)v[y1] + 0.5, py2 = (double)v[y2] - 0.5;
  printf(
      "%.8lf"
      " "
      "%.8lf"
      "\n",
      px1, px2);
  printf(
      "%.8lf"
      " "
      "%.8lf"
      "\n",
      py1, py2);
  exit(0);
}
void Dfs(int x) {
  if (x > 9) {
    Check();
    return;
  }
  for (int i = (1), end = (9); i <= end; ++i)
    if (!vs[i]) {
      vs[i] = 1, ord[x] = d[i];
      Dfs(x + 1);
      vs[i] = 0;
    }
}
int main() {
  Init();
  Dfs(1);
  printf("-1\n");
  return 0;
}