#include <bits/stdc++.h>
using namespace std;
double eps = 1e-7;
int x[8], y[8];
double dist(double x1, double y1, double x2, double y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
bool rect_ok(vector<int>& indx) {
  double cx, cy;
  double sumx = 0, sumy = 0;
  for (int i = 0; i < 4; ++i) {
    sumx += x[indx[i]];
    sumy += y[indx[i]];
  }
  sumx /= 4;
  sumy /= 4;
  double dist1 = dist(x[indx[0]], y[indx[0]], sumx, sumy);
  double dist2 = dist(x[indx[1]], y[indx[1]], sumx, sumy);
  double dist3 = dist(x[indx[2]], y[indx[2]], sumx, sumy);
  double dist4 = dist(x[indx[3]], y[indx[3]], sumx, sumy);
  return fabs(dist1 - dist2) < eps && fabs(dist1 - dist3) < eps &&
         fabs(dist1 - dist4) < eps;
}
bool sqr_ok(vector<int>& indx) {
  if (!rect_ok(indx)) return false;
  vector<double> dists;
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 4; ++j) {
      if (i == j) continue;
      dists.push_back(dist(x[indx[i]], y[indx[i]], x[indx[j]], y[indx[j]]));
    }
  }
  sort(dists.begin(), dists.end());
  int steps = 0;
  for (int i = 0; i < dists.size() - 1; ++i)
    if (dists[i + 1] - dists[i] > eps) steps++;
  return steps == 1;
}
int main() {
  for (int i = 0; i < 8; ++i) {
    cin >> x[i] >> y[i];
  }
  for (int i = 0; i < (1 << 8); ++i) {
    if (__builtin_popcount(i) != 4) continue;
    vector<int> squarevec, rectvec;
    for (int j = 0; j < 8; ++j) {
      if (i & (1 << j))
        squarevec.push_back(j);
      else
        rectvec.push_back(j);
    }
    if (sqr_ok(squarevec) && rect_ok(rectvec)) {
      printf("YES\n");
      for (int j = 0; j < 8; ++j) {
        if (i & (1 << j)) printf("%d ", j + 1);
      }
      printf("\n");
      for (int j = 0; j < 8; ++j) {
        if (!(i & (1 << j))) printf("%d ", j + 1);
      }
      printf("\n");
      return 0;
    }
  }
  printf("NO\n");
}
