#include <bits/stdc++.h>
using namespace std;
int x[8], y[8];
int a[4], b[4];
double dist(int j, int k) { return hypot(x[j] - x[k], y[j] - y[k]); }
double lho(double j, double k) { return fabs(j - k) < 1e-9; }
bool issquare(int p[]) {
  do {
    int a = p[0], b = p[1], c = p[2], d = p[3];
    double AB = dist(a, b);
    double CD = dist(c, d);
    double AC = dist(a, c);
    double BD = dist(b, d);
    double AD = dist(a, d);
    double BC = dist(b, c);
    if (lho(AB, CD) && lho(AB, AC) && lho(AC, BD) && lho(BC, AD)) return true;
  } while (next_permutation(p, p + 4));
  return false;
}
bool isrectangle(int p[]) {
  do {
    int a = p[0], b = p[1], c = p[2], d = p[3];
    double AB = dist(a, b);
    double CD = dist(c, d);
    double AC = dist(a, c);
    double BD = dist(b, d);
    double AD = dist(a, d);
    double BC = dist(b, c);
    if (lho(AB, CD) && lho(AC, BD) && lho(BC, AD)) return true;
  } while (next_permutation(p, p + 4));
  return false;
}
int main() {
  for (int i = 0; i < (int)8; i++) scanf("%d%d", &x[i], &y[i]);
  for (int k = 0; k < (int)1 << 8; k++)
    if (__builtin_popcount(k) == 4) {
      int A = 0, B = 0;
      for (int i = 0; i < (int)8; i++)
        if (k & (1 << i))
          a[A++] = i;
        else
          b[B++] = i;
      if (issquare(a) && isrectangle(b)) {
        puts("YES");
        for (int i = 0; i < (int)4; i++) printf("%d ", a[i] + 1);
        printf("\n");
        for (int i = 0; i < (int)4; i++) printf("%d ", b[i] + 1);
        printf("\n");
        return 0;
      }
    }
  puts("NO");
}
