#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y;
} p[8];
int a[10];
bool rec(int i1, int i2, int i3, int i4) {
  node a = p[i1], b = p[i2], c = p[i3], d = p[i4];
  bool ret = c.x - a.x == d.x - b.x && c.y - a.y == d.y - b.y;
  if ((c.x - a.x) * (b.x - a.x) + (c.y - a.y) * (b.y - a.y) != 0) ret = 0;
  if (a.x == b.x && a.y == b.y) ret = 0;
  return ret;
}
bool squ(int i1, int i2, int i3, int i4) {
  node a = p[i1], b = p[i2], c = p[i3], d = p[i4];
  bool ret = (c.x == a.x + a.y - b.y && c.y == a.y + b.x - a.x &&
              d.x == b.x + a.y - b.y && d.y == b.y + b.x - a.x);
  if (a.x == b.x && a.y == b.y) ret = 0;
  return ret;
}
int main() {
  int i;
  for (i = 0; i < 8; i++) a[i] = i;
  for (i = 0; i < 8; i++) scanf("%d%d", &p[i].x, &p[i].y);
  do {
    if (squ(a[0], a[1], a[2], a[3]) && rec(a[4], a[5], a[6], a[7])) {
      puts("YES");
      for (i = 0; i < 8; i++) {
        printf("%d ", a[i] + 1);
        if (i == 3) printf("\n");
      }
      return 0;
    }
  } while (next_permutation(a, a + 8));
  puts("NO");
  return 0;
}
