#include <bits/stdc++.h>
using namespace std;
int n, top;
int tree[10001000], lson[10001000], rson[10001000], root[100100];
struct ty {
  int x, y;
} s[100100];
bool operator<(ty c1, ty c2) { return c1.x < c2.x; }
int a[12];
int used[12], val[5][5];
int maxx1, maxx2, minn1, minn2;
void build(int la, int now, int left, int right, int x) {
  if (left == right) {
    tree[now] = tree[la] + 1;
    return;
  }
  int mid = left + right >> 1;
  if (x <= mid) {
    lson[now] = ++top;
    rson[now] = rson[la];
    build(lson[la], lson[now], left, mid, x);
  } else {
    lson[now] = lson[la];
    rson[now] = ++top;
    ++mid;
    build(rson[la], rson[now], mid, right, x);
  }
  tree[now] = tree[lson[now]] + tree[rson[now]];
}
int ask(int la, int now, int head, int tail, int c) {
  if (head == tail) return head;
  int mid = head + tail >> 1;
  if (tree[lson[now]] - tree[lson[la]] >= c)
    return ask(lson[la], lson[now], head, mid, c);
  return ask(rson[la], rson[now], mid + 1, tail,
             c - tree[lson[now]] + tree[lson[la]]);
}
void check() {
  int k1, k2, w;
  k1 = val[1][1] + val[1][2] + val[1][3];
  k2 = k1 + val[2][1] + val[2][2] + val[2][3];
  if (s[k1].x == s[k1 + 1].x) return;
  if (s[k2].x == s[k2 + 1].x) return;
  minn1 = minn2 = 2 * 1e9;
  maxx1 = maxx2 = -2 * 1e9;
  w = ask(root[0], root[k1], -1000000000, 1000000000, val[1][1]);
  minn1 = w;
  w = ask(root[0], root[k1], -1000000000, 1000000000, val[1][1] + 1);
  maxx1 = w;
  w = ask(root[0], root[k1], -1000000000, 1000000000, val[1][1] + val[1][2]);
  minn2 = w;
  w = ask(root[0], root[k1], -1000000000, 1000000000,
          val[1][1] + val[1][2] + 1);
  maxx2 = w;
  w = ask(root[k1], root[k2], -1000000000, 1000000000, val[2][1]);
  if (w > minn1) minn1 = w;
  w = ask(root[k1], root[k2], -1000000000, 1000000000, val[2][1] + 1);
  if (maxx1 > w) maxx1 = w;
  w = ask(root[k1], root[k2], -1000000000, 1000000000, val[2][1] + val[2][2]);
  if (w > minn2) minn2 = w;
  w = ask(root[k1], root[k2], -1000000000, 1000000000,
          val[2][1] + val[2][2] + 1);
  if (maxx2 > w) maxx2 = w;
  w = ask(root[k2], root[n], -1000000000, 1000000000, val[3][1]);
  if (w > minn1) minn1 = w;
  w = ask(root[k2], root[n], -1000000000, 1000000000, val[3][1] + 1);
  if (maxx1 > w) maxx1 = w;
  w = ask(root[k2], root[n], -1000000000, 1000000000, val[3][1] + val[3][2]);
  if (w > minn2) minn2 = w;
  w = ask(root[k2], root[n], -1000000000, 1000000000,
          val[3][1] + val[3][2] + 1);
  if (maxx2 > w) maxx2 = w;
  if (minn1 < maxx1 && minn2 < maxx2) {
    printf("%lf %lf\n%lf %lf\n", 0.5 + s[k1].x, 0.5 + s[k2].x, 0.5 + minn1,
           0.5 + minn2);
    exit(0);
  }
}
void dfs(int xx, int yy) {
  if (xx == 4) {
    check();
    return;
  }
  for (int i = 1; i <= 9; ++i)
    if (!used[i]) {
      used[i] = 1;
      val[xx][yy] = a[i];
      if (yy == 3)
        dfs(xx + 1, 1);
      else
        dfs(xx, yy + 1);
      used[i] = 0;
    }
}
int main() {
  int i, j;
  scanf("%d", &n);
  for (i = 1; i <= n; ++i) scanf("%d%d", &s[i].x, &s[i].y);
  sort(s + 1, s + n + 1);
  for (i = 1; i <= n; ++i) {
    root[i] = ++top;
    build(root[i - 1], root[i], -1000000000, 1000000000, s[i].y);
  }
  for (i = 1; i <= 9; ++i) scanf("%d", a + i);
  dfs(1, 1);
  puts("-1");
  return 0;
}
