#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
using namespace std;
using lli = long long;
using ld = long double;
using ii = pair<int, int>;
using vi = vector<int>;
int sgn(ld x) { return x > 0 ? 1 : (x < 0 ? -1 : 0); }
const ld eps = 1e-4;
struct P {
  ld x, y;
  explicit P(ld x = 0, ld y = 0) : x(x), y(y) {}
  P operator+(const P &p) const { return P(x + p.x, y + p.y); }
  P operator-(const P &p) const { return P(x - p.x, y - p.y); }
  P operator*(ld k) const { return P(x * k, y * k); }
  P operator/(ld k) const { return P(x / k, y / k); }
  ld dot(const P &p) const { return x * p.x + y * p.y; }
  ld cross(const P &p) const { return x * p.y - y * p.x; }
  ld norm() const { return x * x + y * y; }
  ld length() const { return sqrtl(norm()); }
  ld angle() { return atan2(y, x); }
  P perp() const { return P(-y, x); }
  P unit() const { return (*this) / length(); }
  P rotate(ld angle) const {
    return P(x * cos(angle) - y * sin(angle), x * sin(angle) + y * cos(angle));
  }
  bool operator==(const P &p) const {
    return abs((x) - (p.x)) <= eps && abs((y) - (p.y)) <= eps;
  }
  bool operator!=(const P &p) const {
    return !abs((x) - (p.x)) <= eps || !abs((y) - (p.y)) <= eps;
  }
  friend ostream &operator<<(ostream &os, const P &p) {
    return os << "(" << p.x << ", " << p.y << ")";
  }
  friend istream &operator>>(istream &is, P &p) { return cin >> p.x >> p.y; }
};
P pts[10];
vi order(8);
bool parallel(P a, P b) { return abs((a.cross(b)) - (0)) <= eps; }
bool pointInSegment(P a, P b, P p) {
  return abs(((b - a).cross(p - a)) - (0)) <= eps &&
         ((a - p).dot(b - p)) - (0) <= eps;
}
bool checkAngles(int l, int r) {
  vector<P> fig = {pts[order[l]], pts[order[l + 1]], pts[order[l + 3]],
                   pts[order[l + 2]]};
  ;
  for (auto i = (0) - ((0) > (4)); i != 4 - ((0) > (4));
       i += 1 - 2 * ((0) > (4))) {
    P prev = fig[(i + 3) % 4];
    P cur = fig[i];
    P nxt = fig[(i + 1) % 4];
    ;
    ;
    if (!abs(((prev - cur).dot(nxt - cur)) - (0)) <= eps) return 0;
    ;
  }
  return 1;
}
struct Order {
  bool operator()(const ld &a, const ld &b) const { return (a) - (b) < -eps; }
};
bool square() {
  P a = pts[order[0]], b = pts[order[1]], c = pts[order[2]], d = pts[order[3]];
  P ab = b - a, ac = c - a, cd = d - c, bd = d - b;
  set<ld, Order> st = {ab.norm(), ac.norm(), cd.norm(), bd.norm()};
  if (int(st.size()) != 1) return 0;
  if (!parallel(ab, cd) || !parallel(ac, bd)) return 0;
  if (pointInSegment(a, b, c) || pointInSegment(a, b, d)) return 0;
  if (pointInSegment(c, d, a) || pointInSegment(c, d, b)) return 0;
  if (pointInSegment(a, c, b) || pointInSegment(a, c, d)) return 0;
  if (pointInSegment(b, d, a) || pointInSegment(b, d, c)) return 0;
  return checkAngles(0, 3);
}
bool rectangle() {
  P a = pts[order[4]], b = pts[order[5]], c = pts[order[6]], d = pts[order[7]];
  P ab = b - a, ac = c - a, cd = d - c, bd = d - b;
  set<ld, Order> st = {ab.norm(), ac.norm(), cd.norm(), bd.norm()};
  if (int(st.size()) == 1 || int(st.size()) == 2) {
    if (!parallel(ab, cd) || !parallel(ac, bd)) return 0;
    if (pointInSegment(a, b, c) || pointInSegment(a, b, d)) return 0;
    if (pointInSegment(c, d, a) || pointInSegment(c, d, b)) return 0;
    if (pointInSegment(a, c, b) || pointInSegment(a, c, d)) return 0;
    if (pointInSegment(b, d, a) || pointInSegment(b, d, c)) return 0;
    return checkAngles(4, 7);
  } else {
    return 0;
  }
}
bool can() {
  ;
  return square() && rectangle();
}
int main() {
  cin.tie(0)->sync_with_stdio(0), cout.tie(0);
  for (auto i = (1) - ((1) > (9)); i != 9 - ((1) > (9));
       i += 1 - 2 * ((1) > (9)))
    cin >> pts[i];
  iota(begin(order), end(order), 1);
  do {
    if (can()) {
      cout << "YES\n";
      for (auto i = (0) - ((0) > (8)); i != 8 - ((0) > (8));
           i += 1 - 2 * ((0) > (8)))
        cout << order[i] << " \n"[i == 3 || i == 7];
      return 0;
    }
  } while (next_permutation(begin(order), end(order)));
  cout << "NO\n";
  return 0;
}
