#include <bits/stdc++.h>
using namespace std;
int i, j, h, p, t, t1, t2, dem;
int a[10][2], rec[10], square[10], d[10][10];
bool check[10], OK, OK1, OK2;
int main() {
  for (i = 1; i <= 8; ++i) scanf("%d%d", &a[i][0], &a[i][1]);
  memset(check, true, sizeof(check));
  for (i = 1; i <= 8; ++i)
    for (j = i + 1; j <= 8; ++j) {
      t1 = (a[i][0] - a[j][0]) * (a[i][0] - a[j][0]);
      t2 = (a[i][1] - a[j][1]) * (a[i][1] - a[j][1]);
      d[i][j] = t1 + t2;
      d[j][i] = d[i][j];
    }
  OK = false;
  for (i = 1; i <= 8; ++i) {
    check[i] = false;
    rec[1] = i;
    for (j = i + 1; j <= 8; ++j) {
      check[j] = false;
      rec[2] = j;
      for (h = j + 1; h <= 8; ++h) {
        check[h] = false;
        rec[3] = h;
        for (p = h + 1; p <= 8; ++p) {
          if (i == 5 && j == 6 && h == 7 && p == 8) check[i] = check[i];
          check[p] = false;
          rec[4] = p;
          dem = 0;
          for (t = 1; t <= 8; ++t)
            if (check[t]) square[++dem] = t;
          OK1 = false;
          if (d[rec[1]][rec[2]] == d[rec[3]][rec[4]]) {
            if (d[rec[1]][rec[3]] == d[rec[2]][rec[4]] &&
                d[rec[1]][rec[4]] == d[rec[2]][rec[3]])
              OK1 = true;
          }
          if (d[rec[1]][rec[3]] == d[rec[2]][rec[4]]) {
            if (d[rec[1]][rec[2]] == d[rec[3]][rec[4]] &&
                d[rec[1]][rec[4]] == d[rec[2]][rec[3]])
              OK1 = true;
          }
          OK2 = false;
          if (d[square[1]][square[2]] == d[square[3]][square[4]]) {
            t = d[square[1]][square[2]];
            t1 = d[square[1]][square[3]];
            t2 = d[square[1]][square[4]];
            if (d[square[1]][square[3]] == d[square[2]][square[4]] &&
                d[square[1]][square[4]] == d[square[2]][square[3]] &&
                (t == t1 || t == t2))
              OK2 = true;
          }
          if (d[square[1]][square[3]] == d[square[2]][square[4]]) {
            t = d[square[1]][square[3]];
            t1 = d[square[1]][square[2]];
            t2 = d[square[1]][square[4]];
            if (d[square[1]][square[2]] == d[square[3]][square[4]] &&
                d[square[1]][square[4]] == d[square[2]][square[3]] &&
                (t == t1 || t == t2))
              OK2 = true;
          }
          if (OK1 && OK2) OK = true;
          if (OK) break;
          check[p] = true;
        }
        if (OK) break;
        check[h] = true;
      }
      if (OK) break;
      check[j] = true;
    }
    if (OK) break;
    check[i] = true;
  }
  if (!OK)
    cout << "NO";
  else {
    cout << "YES" << endl;
    for (i = 1; i <= 4; ++i) cout << square[i] << " ";
    cout << endl;
    for (i = 1; i <= 4; ++i) cout << rec[i] << " ";
    cout << endl;
  }
  return 0;
}
