#include <bits/stdc++.h>
using namespace std;
int d[9][9], a[9], b[9], x[9], y[9], i, j;
int n, m = 1;
int main() {
  for (i = 1; i <= 8; i++) cin >> x[i] >> y[i];
  for (i = 1; i <= 8; i++) a[i] = i, m *= i;
  for (; m > 0; m--) {
    for (i = 1; i <= 8; i++)
      for (j = 1; j <= 8; j++)
        d[i][j] = ((x[a[i]] - x[a[j]]) * (x[a[i]] - x[a[j]])) +
                  ((y[a[i]] - y[a[j]]) * (y[a[i]] - y[a[j]]));
    if (d[1][2] + d[2][3] == d[1][3] && d[1][4] + d[4][3] == d[1][3] &&
        d[1][2] == d[2][3] && d[1][4] == d[4][3]) {
      if (d[5][6] + d[6][7] == d[5][7] && d[5][8] + d[8][7] == d[5][7]) {
        puts("YES");
        for (i = 1; i <= 4; i++) cout << a[i] << " ";
        puts("");
        for (i = 5; i <= 8; i++) cout << a[i] << " ";
        return 0;
      }
    }
    next_permutation(a + 1, a + 9);
  }
  puts("NO");
  return 0;
}
