#include <bits/stdc++.h>
using namespace std;
const double INF = 1000 * 1000 * 1000;
struct point {
  double x, y;
};
point A[10];
double dist(point a, point b) {
  return sqrt((b.x - a.x) * (b.x - a.x) + (b.y - a.y) * (b.y - a.y));
}
double enorm(point vect) { return sqrt(vect.x * vect.x + vect.y * vect.y); }
double scal(point a, point b) { return a.x * b.x + a.y * b.y; }
point norm(point a, point b) {
  point t;
  t.x = b.x - a.x;
  t.y = b.y - a.y;
  return t;
}
bool isquad1(point a, point b, point c, point d) {
  double dab, dbc, dcd, dda;
  dab = sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
  dbc = sqrt((b.x - c.x) * (b.x - c.x) + (b.y - c.y) * (b.y - c.y));
  dcd = sqrt((c.x - d.x) * (c.x - d.x) + (c.y - d.y) * (c.y - d.y));
  dda = sqrt((d.x - a.x) * (d.x - a.x) + (d.y - a.y) * (d.y - a.y));
  if (dab == dbc && dab == dcd && dab == dda) {
    double f_dab, f_abc, f_bcd, f_cda;
    point a1, b1;
    a1 = norm(a, d), b1 = norm(a, b);
    f_dab = scal(a1, b1) / (enorm(a1) * enorm(b1));
    a1 = norm(b, a), b1 = norm(b, c);
    f_abc = scal(a1, b1) / (enorm(a1) * enorm(b1));
    a1 = norm(c, b), b1 = norm(c, d);
    f_bcd = scal(a1, b1) / (enorm(a1) * enorm(b1));
    a1 = norm(d, c), b1 = norm(d, a);
    f_cda = scal(a1, b1) / (enorm(a1) * enorm(b1));
    if (fabs(f_dab + f_abc + f_bcd + f_cda) == 0)
      return true;
    else
      return false;
  }
  return false;
}
bool isquad2(point a, point b, point c, point d) {
  double dab, dbc, dcd, dda;
  dab = sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
  dbc = sqrt((b.x - c.x) * (b.x - c.x) + (b.y - c.y) * (b.y - c.y));
  dcd = sqrt((c.x - d.x) * (c.x - d.x) + (c.y - d.y) * (c.y - d.y));
  dda = sqrt((d.x - a.x) * (d.x - a.x) + (d.y - a.y) * (d.y - a.y));
  if (dab == dcd && dda == dbc) {
    double f_dab, f_abc, f_bcd, f_cda;
    point a1, b1;
    a1 = norm(a, d), b1 = norm(a, b);
    f_dab = scal(a1, b1) / (enorm(a1) * enorm(b1));
    a1 = norm(b, a), b1 = norm(b, c);
    f_abc = scal(a1, b1) / (enorm(a1) * enorm(b1));
    a1 = norm(c, b), b1 = norm(c, d);
    f_bcd = scal(a1, b1) / (enorm(a1) * enorm(b1));
    a1 = norm(d, c), b1 = norm(d, a);
    f_cda = scal(a1, b1) / (enorm(a1) * enorm(b1));
    if (fabs(f_dab + f_abc + f_bcd + f_cda) == 0)
      return true;
    else
      return false;
  }
  return false;
}
long double isleft(pair<double, pair<double, double>> p2,
                   pair<double, pair<double, double>> p1,
                   pair<double, pair<double, double>> p0) {
  long double p2x = p2.second.first, p2y = p2.second.second;
  long double p1x = p1.second.first, p1y = p1.second.second;
  long double p0x = p0.second.first, p0y = p0.second.second;
  return (p1x - p0x) * (p2y - p0y) - (p2x - p0x) * (p1y - p0y);
}
bool ch(point a, point b, point c, point d, bool pr) {
  vector<pair<double, pair<double, double>>> P, Pt;
  vector<pair<double, pair<double, double>>> S;
  vector<point> V;
  V.push_back(a);
  V.push_back(b);
  V.push_back(c);
  V.push_back(d);
  long double tx, ty;
  int ti;
  tx = INF, ty = INF, ti = -1;
  for (int i = 0; i < 4; ++i) {
    double x = V[i].x, y = V[i].y;
    P.push_back(make_pair(-1, make_pair(x, y)));
    if (y < ty) {
      tx = x;
      ty = y;
      ti = i;
    } else {
      if (y == ty && x < tx) {
        tx = x;
        ty = y;
        ti = i;
      }
    }
  }
  for (size_t i = 0; i < P.size(); ++i) {
    long double x = P[i].second.first;
    long double y = P[i].second.second;
    P[i].first = atan2(y - ty, x - tx);
    if (i != ti) Pt.push_back(P[i]);
  }
  S.push_back(P[ti]);
  sort(Pt.begin(), Pt.end());
  S.push_back(Pt[0]);
  size_t i = 0;
  while (i < Pt.size()) {
    int size = (int)S.size();
    if (S.size() >= 2) {
      if (isleft(Pt[i], S[size - 1], S[size - 2]))
        S.push_back(Pt[i]), i++;
      else
        S.pop_back(), size--;
    } else
      S.push_back(Pt[i]), i++;
  }
  if (S.size() == 4) {
    point a1, b1, c1, d1;
    a1.x = S[0].second.first, a1.y = S[0].second.second;
    b1.x = S[1].second.first, b1.y = S[1].second.second;
    c1.x = S[2].second.first, c1.y = S[2].second.second;
    d1.x = S[3].second.first, d1.y = S[3].second.second;
    if (isquad1(a1, b1, c1, d1)) {
      return true;
    }
    if (pr)
      if (isquad2(a1, b1, c1, d1) || isquad2(b1, c1, a1, d1)) return true;
  }
  return false;
}
bool isquad(point a, point b, point c, point d, bool pr) {
  double dab, dbc, dcd, dda;
  dab = sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
  dbc = sqrt((b.x - c.x) * (b.x - c.x) + (b.y - c.y) * (b.y - c.y));
  dcd = sqrt((c.x - d.x) * (c.x - d.x) + (c.y - d.y) * (c.y - d.y));
  dda = sqrt((d.x - a.x) * (d.x - a.x) + (d.y - a.y) * (d.y - a.y));
  bool add = true;
  if (!(scal(norm(a, b), norm(b, c)) == 0 &&
        scal(norm(b, c), norm(c, d)) == 0 && scal(norm(c, d), norm(d, a)) == 0))
    return false;
  if (pr) {
    if (dab == dbc && dab == dcd && dab == dda) {
      return true;
    } else {
      return false;
    }
  }
  return true;
}
void load() {
  double x, y;
  for (int i = 0; i < 8; ++i) {
    cin >> x >> y;
    A[i].x = x, A[i].y = y;
  }
}
vector<int> Q1, Q2;
void solve() {
  for (int i1 = 0; i1 < 8; ++i1)
    for (int i2 = 0; i2 < 8; ++i2)
      for (int i3 = 0; i3 < 8; ++i3)
        for (int i4 = 0; i4 < 8; ++i4) {
          if (i1 != i2 && i1 != i3 && i1 != i4 && i2 != i3 && i2 != i4 &&
              i3 != i4) {
            int key = 0;
            if (isquad(A[i1], A[i2], A[i3], A[i4], 1)) {
              key |= 1 << i1;
              key |= 1 << i2;
              key |= 1 << i3;
              key |= 1 << i4;
              Q1.push_back(key);
            }
          }
        }
  for (int i1 = 0; i1 < 8; ++i1)
    for (int i2 = 0; i2 < 8; ++i2)
      for (int i3 = 0; i3 < 8; ++i3)
        for (int i4 = 0; i4 < 8; ++i4) {
          if (i1 != i2 && i1 != i3 && i1 != i4 && i2 != i3 && i2 != i4 &&
              i3 != i4) {
            int key = 0;
            if (isquad(A[i1], A[i2], A[i3], A[i4], 0)) {
              key |= 1 << i1;
              key |= 1 << i2;
              key |= 1 << i3;
              key |= 1 << i4;
              Q2.push_back(key);
            }
          }
        }
  for (int i = 0; i < Q1.size(); ++i)
    for (int j = 0; j < Q2.size(); ++j) {
      if (Q1[i] != Q2[j] && (Q1[i] + Q2[j]) == 255) {
        cout << "YES" << endl;
        int q1 = Q1[i], q2 = Q2[j];
        int i = 1;
        while (q1) {
          if (q1 & 1) cout << i << " ";
          q1 >>= 1, i++;
        }
        cout << endl;
        i = 1;
        while (q2) {
          if (q2 & 1) cout << i << " ";
          q2 >>= 1, i++;
        }
        cout << endl;
        exit(0);
      }
    }
  cout << "NO" << endl;
  exit(0);
}
int main() {
  load();
  solve();
  return 0;
}
