#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline string toString(T a) {
  ostringstream os("");
  os << a;
  return os.str();
}
template <typename T>
inline long long toLong(T a) {
  long long res;
  istringstream os(a);
  os >> res;
  return res;
}
template <typename T>
inline T S(T a) {
  return a * a;
}
template <typename T>
inline T gcd(T a, T b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
template <typename T>
inline unsigned long long bigmod(T a, T b, T m) {
  if (b == 0)
    return 1;
  else if (b % 2 == 0)
    return S(bigmod(a, b / 2, m)) % m;
  else
    return (a % m * bigmod(a, b - 1, m)) % m;
}
template <typename T>
inline vector<string> parse(T str) {
  vector<string> res;
  string s;
  istringstream os(str);
  while (os >> s) res.push_back(s);
  return res;
}
template <typename T>
inline unsigned long long dist(T A, T B) {
  unsigned long long res =
      (A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y);
  return res;
}
template <typename T>
inline double cosAngle(T a, T b, T c) {
  double res = a * a + b * b - c * c;
  res = res / (2 * a * b);
  res = acos(res);
  return res;
}
template <typename T>
inline T power(T base, int po) {
  T res = 1;
  if (base == 0) return 0;
  for (int i = (0); i < (po); i++) res *= base;
  return res;
}
template <typename T>
inline bool isOn(T mask, T pos) {
  return mask & (1 << pos);
}
template <typename T>
inline int Off(T mask, T pos) {
  return mask ^ (1 << pos);
}
template <typename T>
inline int On(T mask, T pos) {
  return mask | (1 << pos);
}
string str;
int len;
pair<int, int> P[100015];
int ary[100015];
int hi;
struct Z {
  vector<int> v;
};
Z tree[4 * 100015];
int N;
vector<int> tmp;
map<pair<pair<int, int>, int>, int> M;
void insert(int cur, int st, int ed) {
  if (st == ed) {
    tree[cur].v.push_back(P[st].second);
    return;
  }
  int mid, lft, rgt;
  mid = (st + ed) / 2;
  lft = 2 * cur;
  rgt = lft + 1;
  insert(lft, st, mid);
  insert(rgt, mid + 1, ed);
  for (int i = st; i <= ed; i++) {
    tree[cur].v.push_back(P[i].second);
  }
  sort((tree[cur].v).begin(), (tree[cur].v).end());
}
int query(int cur, int st, int ed, int x, int y, int val) {
  if (st == x && ed == y)
    return upper_bound((tree[cur].v).begin(), (tree[cur].v).end(), val) -
           tree[cur].v.begin();
  int mid = (st + ed) / 2;
  if (y <= mid)
    return query(2 * cur, st, mid, x, y, val);
  else if (x > mid)
    return query(2 * cur + 1, mid + 1, ed, x, y, val);
  else
    return query(2 * cur, st, mid, x, mid, val) +
           query(2 * cur + 1, mid + 1, ed, mid + 1, y, val);
}
int find(int need, int x, int y) {
  pair<int, int> pp = make_pair(x, y);
  pair<pair<int, int>, int> ppp = make_pair(pp, need);
  if (M.find(ppp) == M.end()) {
    int low, high, mid;
    low = 1, high = N;
    int res = hi;
    while (low <= high) {
      mid = (low + high) / 2;
      int ase = query(1, 1, N, x, y, ary[mid]);
      if (ase == need) res = ary[mid];
      if (ase >= need) {
        high = mid - 1;
      } else
        low = mid + 1;
    }
    M[ppp] = res;
    return res;
  }
  return M[ppp];
}
pair<int, int> RS;
bool check(int a, int b, int c) {
  int y1, y2;
  y1 = find(tmp[0], 1, a);
  y1 = (y1 > find(tmp[3], a + 1, b) ? y1 : find(tmp[3], a + 1, b));
  y1 = (y1 > find(tmp[6], b + 1, c) ? y1 : find(tmp[6], b + 1, c));
  if (y1 == hi) return false;
  if (query(1, 1, N, 1, a, y1) != tmp[0]) return false;
  if (query(1, 1, N, a + 1, b, y1) != tmp[3]) return false;
  if (query(1, 1, N, b + 1, c, y1) != tmp[6]) return false;
  y2 = find(tmp[0] + tmp[1], 1, a);
  y2 = (y2 > find(tmp[3] + tmp[4], a + 1, b) ? y2
                                             : find(tmp[3] + tmp[4], a + 1, b));
  y2 = (y2 > find(tmp[6] + tmp[7], b + 1, c) ? y2
                                             : find(tmp[6] + tmp[7], b + 1, c));
  if (y2 == hi) return false;
  if (query(1, 1, N, 1, a, y2) != (tmp[0] + tmp[1])) return false;
  if (query(1, 1, N, a + 1, b, y2) != (tmp[3] + tmp[4])) return false;
  if (query(1, 1, N, b + 1, c, y2) != (tmp[6] + tmp[7])) return false;
  RS = make_pair(y1, y2);
  return true;
}
int main() {
  int i, j, k;
  int ks, cas;
  int n, m;
  cin >> n;
  pair<int, int> p;
  N = n;
  for (int i = (1); i < (n + 1); i++) {
    scanf("%d%d", &p.first, &p.second);
    P[i] = p;
    ary[i] = p.second;
  }
  sort(P + 1, P + n + 1);
  insert(1, 1, n);
  hi = 1000000007;
  int baki = 9000;
  for (i = 0; i < 9; i++) {
    cin >> k;
    tmp.push_back(k);
  }
  sort((tmp).begin(), (tmp).end());
  sort(ary + 1, ary + n + 1);
  int a, b, c;
  int y1, y2;
  bool state = 1;
  int it = 0;
  do {
    a = tmp[0] + tmp[1] + tmp[2];
    b = a + tmp[3] + tmp[4] + tmp[5];
    c = N;
    if ((P[a].first == P[a + 1].first) || (P[b].first == P[b + 1].first))
      ;
    else {
      if (check(a, b, c)) {
        y1 = RS.first;
        y2 = RS.second;
        double aa, bb, cc, dd;
        aa = (double)P[a].first + 0.5;
        bb = (double)P[b].first + 0.5;
        cc = (double)y1 + 0.5;
        dd = (double)y2 + 0.5;
        cout << setprecision(10) << fixed;
        cout << aa << " " << bb << "\n" << cc << " " << dd << endl;
        return 0;
      }
    }
  } while (next_permutation((tmp).begin(), (tmp).end()) && state == true);
  if (state) {
    puts("-1");
  }
  return 0;
}
