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;
const int maxn = 100100, INF = 0x7fffffff, _INF = 0x80000000;
class Splay_Tree {
 public:
  int tot, root;
  struct Splay_Node {
    int c[2], fa, key, cnt, size;
    Splay_Node() {
      c[0] = c[1] = fa = key = cnt = size = 0;
      return;
    }
  } p[maxn + 10];
  void Init() {
    p[1].c[0] = p[1].size = tot = 2;
    p[1].key = INF;
    p[2].key = _INF;
    p[1].cnt = p[2].cnt = p[2].size = p[2].fa = root = 1;
    return;
  }
  inline bool Gr(int k) { return p[p[k].fa].c[0] != k; }
  inline void Update(int k) {
    p[k].size = p[k].cnt + p[p[k].c[0]].size + p[p[k].c[1]].size;
    return;
  }
  void Rotate(int a, bool t) {
    int b = p[a].c[t ^ 1];
    if (p[b].fa = p[a].fa)
      p[p[a].fa].c[Gr(a)] = b;
    else
      root = b;
    if (p[a].c[t ^ 1] = p[b].c[t]) p[p[b].c[t]].fa = a;
    p[b].c[t] = a;
    p[a].fa = b;
    Update(a);
    Update(b);
    return;
  }
  void Splay(int k, int t = 0) {
    while (p[k].fa != t) {
      int F = p[k].fa, G = p[F].fa;
      if (G != t) {
        if (Gr(k) != Gr(F)) {
          Rotate(F, Gr(k) ^ 1);
          Rotate(G, Gr(k) ^ 1);
        } else {
          Rotate(G, Gr(F) ^ 1);
          Rotate(F, Gr(k) ^ 1);
        }
      } else
        Rotate(F, Gr(k) ^ 1);
    }
    return;
  }
  int Insert(int k, int key) {
    if (key != p[k].key) {
      bool t = key > p[k].key;
      while (p[k].c[t] && key != p[p[k].c[t]].key)
        t = key > p[k = p[k].c[t]].key;
      if (!p[k].c[t]) {
        p[p[k].c[t] = ++tot].key = key;
        p[tot].fa = k;
        k = tot;
      } else
        k = p[k].c[t];
    }
    ++p[k].cnt;
    ++p[k].size;
    Splay(k);
    return k;
  }
  int Rank(int k, int key) {
    int rank = -1;
    while (k && key != p[k].key) {
      bool t = key > p[k].key;
      if (t) rank += p[p[k].c[0]].size + p[k].cnt;
      k = p[k].c[t];
    }
    if (k && key == p[k].key) rank += p[k].cnt;
    return rank + p[p[k].c[0]].size;
  }
} ST;
int n;
struct Point {
  int x, y;
} P[maxn];
bool cmp1(Point a, Point b) { return a.x < b.x; }
bool cmp2(Point a, Point b) { return a.y < b.y; }
int v1[maxn], v2[maxn];
bool vis1[maxn], vis2[maxn];
int p[10], c[10];
int k = 0;
struct node1 {
  int lx1, lx2, ly1, ly2, t1, t2, t3, t4;
  bool flag;
} mes[maxn << 2];
int tot = -1, head[maxn];
struct node2 {
  int p, next, idx1, idx2;
} edge[maxn << 4];
inline void Add(int u, int v, int idx1, int idx2) {
  edge[++tot] = (node2){v, head[u], idx1, idx2};
  head[u] = tot;
  return;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d%d", &P[i].x, &P[i].y);
  for (int i = 1; i <= 9; ++i) {
    p[i] = i;
    scanf("%d", &c[i]);
  }
  sort(P + 1, P + n + 1, cmp1);
  for (int i = 1, j, sum = 0; i <= n; i = j + 1) {
    for (j = i; j < n && P[j].x == P[j + 1].x; ++j)
      ;
    v1[sum += j - i + 1] = P[i].x;
    vis1[sum] = 1;
  }
  sort(P + 1, P + n + 1, cmp2);
  for (int i = 1, j, sum = 0; i <= n; i = j + 1) {
    for (j = i; j < n && P[j].y == P[j + 1].y; ++j)
      ;
    v2[sum += j - i + 1] = i;
    vis2[sum] = 1;
  }
  memset(head, -1, sizeof(head));
  do {
    int t1 = c[p[1]] + c[p[4]] + c[p[7]], t2 = t1 + c[p[2]] + c[p[5]] + c[p[8]],
        t3 = c[p[1]] + c[p[2]] + c[p[3]], t4 = t3 + c[p[4]] + c[p[5]] + c[p[6]];
    if (vis1[t1] && vis1[t2] && vis2[t3] && vis2[t4]) {
      mes[++k] = (node1){v1[t1],
                         v1[t2],
                         P[v2[t3]].y,
                         P[v2[t4]].y,
                         c[p[1]],
                         c[p[1]] + c[p[2]],
                         c[p[1]] + c[p[4]],
                         c[p[1]] + c[p[2]] + c[p[4]] + c[p[5]],
                         1};
      Add(v2[t3], v1[t1], k, 1);
      Add(v2[t3], v1[t2], k, 2);
      Add(v2[t4], v1[t1], k, 3);
      Add(v2[t4], v1[t2], k, 4);
    }
  } while (next_permutation(p + 1, p + 10));
  ST.Init();
  for (int i = 1, j; i <= n; i = j + 1) {
    for (ST.Insert(ST.root, P[j = i].x); j < n && P[j].y == P[j + 1].y;
         ST.Insert(ST.root, P[++j].x))
      ;
    for (int k = head[i]; ~k; k = edge[k].next) {
      int p = edge[k].p, idx1 = edge[k].idx1, idx2 = edge[k].idx2;
      int cnt = ST.Rank(ST.root, p);
      if (idx2 == 1 && mes[idx1].t1 != cnt) mes[idx1].flag = 0;
      if (idx2 == 2 && mes[idx1].t2 != cnt) mes[idx1].flag = 0;
      if (idx2 == 3 && mes[idx1].t3 != cnt) mes[idx1].flag = 0;
      if (idx2 == 4 && mes[idx1].t4 != cnt) mes[idx1].flag = 0;
    }
  }
  for (int i = 1; i <= k; ++i)
    if (mes[i].flag) {
      printf("%.10lf %.10lf\n%.10lf %.10lf\n", double(mes[i].lx1) + 0.5,
             double(mes[i].lx2) + 0.5, double(mes[i].ly1) + 0.5,
             double(mes[i].ly2) + 0.5);
      return 0;
    }
  puts("-1");
  return 0;
}