#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, l, m, n, v, f, a[10], b[10], p[10], q[10], x[10], y[10], vis[10];
  for (i = 0; i < 8; i++) scanf("%d%d", x + i, y + i);
  for (i = 0; i < 8; i++)
    for (j = i + 1; j < 8; j++)
      for (k = j + 1; k < 8; k++)
        for (l = k + 1; l < 8; l++) {
          f = 0;
          memset(vis, 0, sizeof(vis));
          vis[i] = vis[j] = vis[k] = vis[l] = 1;
          a[0] = i, a[1] = j, a[2] = k, a[3] = l;
          n = 0;
          for (m = 0; m < 8; m++)
            if (!vis[m]) b[n++] = m;
          v = 0;
          for (m = 0; m < 4; m++)
            for (n = m + 1; n < 4; n++)
              p[v++] = (x[a[m]] - x[a[n]]) * (x[a[m]] - x[a[n]]) +
                       (y[a[m]] - y[a[n]]) * (y[a[m]] - y[a[n]]);
          sort(p, p + v);
          if (p[0] == p[1] && p[1] == p[2] && p[2] == p[3] && p[4] == p[5] &&
              2 * p[0] == p[4])
            f++;
          v = 0;
          for (m = 0; m < 4; m++) {
            v = 0;
            for (n = 0; n < 4; n++) {
              if (m == n) continue;
              q[v++] = (x[b[m]] - x[b[n]]) * (x[b[m]] - x[b[n]]) +
                       (y[b[m]] - y[b[n]]) * (y[b[m]] - y[b[n]]);
            }
            sort(q, q + v);
            if (q[0] + q[1] != q[2]) break;
          }
          if (m == 4) f++;
          if (f == 2) {
            printf("YES\n");
            for (i = 0; i < 4; i++) printf("%d ", a[i] + 1);
            printf("\n");
            for (i = 0; i < 4; i++) printf("%d ", b[i] + 1);
            printf("\n");
            return 0;
          }
        }
  printf("NO\n");
  return 0;
}
