#include <bits/stdc++.h>
using namespace std;
double x[10], y[10];
int kk[10];
int dis(int a, int b) {
  return abs((x[a] - x[b]) * (x[a] - x[b]) + (y[a] - y[b]) * (y[a] - y[b]));
}
bool pdz(int a, int b, int c, int d) {
  if ((x[a] + x[b] == x[c] + x[d]) && (y[a] + y[b] == y[c] + y[d]) &&
      dis(a, b) == dis(c, d)) {
    if (x[a] == x[b] && y[c] == y[d]) return true;
    if (y[a] == y[b] && x[c] == x[d]) return true;
    if ((y[a] - y[b]) * (y[d] - y[c]) + (x[d] - x[c]) * (x[a] - x[b]) == 0)
      return true;
  }
  swap(b, c);
  if ((x[a] + x[b] == x[c] + x[d]) && (y[a] + y[b] == y[c] + y[d]) &&
      dis(a, b) == dis(c, d)) {
    if (x[a] == x[b] && y[c] == y[d]) return true;
    if (y[a] == y[b] && x[c] == x[d]) return true;
    if ((y[a] - y[b]) * (y[d] - y[c]) + (x[d] - x[c]) * (x[a] - x[b]) == 0)
      return true;
  }
  swap(b, d);
  if ((x[a] + x[b] == x[c] + x[d]) && (y[a] + y[b] == y[c] + y[d]) &&
      dis(a, b) == dis(c, d)) {
    if (x[a] == x[b] && y[c] == y[d]) return true;
    if (y[a] == y[b] && x[c] == x[d]) return true;
    if ((y[a] - y[b]) * (y[d] - y[c]) + (x[d] - x[c]) * (x[a] - x[b]) == 0)
      return true;
  }
  return false;
}
bool pdc(int a, int b, int c, int d) {
  if ((x[a] + x[b] == x[c] + x[d]) && (y[a] + y[b] == y[c] + y[d]) &&
      dis(a, b) == dis(c, d))
    return true;
  swap(b, c);
  if ((x[a] + x[b] == x[c] + x[d]) && (y[a] + y[b] == y[c] + y[d]) &&
      dis(a, b) == dis(c, d))
    return true;
  swap(b, d);
  if ((x[a] + x[b] == x[c] + x[d]) && (y[a] + y[b] == y[c] + y[d]) &&
      dis(a, b) == dis(c, d))
    return true;
  return false;
}
int main() {
  for (int i = 1; i <= 8; ++i) scanf("%lf%lf", &x[i], &y[i]);
  for (int i = 1; i <= 5; ++i)
    for (int j = i + 1; j <= 6; ++j)
      for (int k = j + 1; k <= 7; ++k)
        for (int h = k + 1; h <= 8; ++h) {
          if (pdz(i, j, k, h) == true) {
            int tot = 0;
            for (int num = 1; num <= 8; ++num)
              if (num != i && num != j && num != k && num != h) kk[++tot] = num;
            if (pdc(kk[1], kk[2], kk[3], kk[4]) == true) {
              printf("YES\n%d %d %d %d\n%d %d %d %d", i, j, k, h, kk[1], kk[2],
                     kk[3], kk[4]);
              return 0;
            }
          }
        }
  printf("NO\n");
  return 0;
}
