#include <bits/stdc++.h>
using namespace std;
int x[9], y[9], v1[9], v2[9];
int ok = 0;
int dot(int a, int b, int c) {
  return (x[b] - x[a]) * (x[c] - x[b]) + (y[b] - y[a]) * (y[c] - y[b]);
}
int dist(int a, int b) {
  return (x[a] - x[b]) * (x[a] - x[b]) + (y[a] - y[b]) * (y[a] - y[b]);
}
int doit(int p[]) {
  int ret = 0, d;
  do {
    int cur = 2;
    d = dist(p[0], p[1]);
    for (int i = 0; i < 3; i++) {
      if (dot(p[i], p[(i + 1) % 4], p[(i + 2) % 4]) != 0) cur = 0;
      if (dist(p[i], p[(i + 1) % 4]) != d) cur = min(cur, 1);
    }
    ret = max(ret, cur);
  } while (next_permutation(p, p + 4));
  return ret;
}
int main() {
  for (int i = 0; i < 8; i++) {
    scanf("%d%d", &x[i], &y[i]);
  }
  for (int i = 0; i < (1 << 8); i++) {
    int cnt = 0;
    for (int j = 0; j < 8; j++) {
      if ((1 << j) & i) cnt++;
    }
    if (cnt != 4) continue;
    int c1, c2;
    c1 = c2 = 0;
    for (int j = 0; j < 8; j++) {
      if ((1 << j) & i)
        v1[c1] = j, c1++;
      else
        v2[c2] = j, c2++;
    }
    int r1, r2;
    r1 = doit(v1);
    r2 = doit(v2);
    if (r1 != 0 && r2 != 0 && (r1 == 2 || r2 == 2)) {
      printf("YES\n");
      if (r1 == 2) {
        for (int j = 0; j < 4; j++) {
          if (j > 0) printf(" ");
          printf("%d", v1[j] + 1);
        }
        printf("\n");
        for (int j = 0; j < 4; j++) {
          if (j > 0) printf(" ");
          printf("%d", v2[j] + 1);
        }
        printf("\n");
      } else {
        for (int j = 0; j < 4; j++) {
          if (j > 0) printf(" ");
          printf("%d", v2[j] + 1);
        }
        printf("\n");
        for (int j = 0; j < 4; j++) {
          if (j > 0) printf(" ");
          printf("%d", v1[j] + 1);
        }
        printf("\n");
      }
      ok = 1;
      break;
    }
  }
  if (ok == 0) printf("NO\n");
}
