#include <bits/stdc++.h>
using namespace std;
struct POINT {
  int x, y;
} P[8];
struct LINE {
  POINT a, b;
};
bool OK;
bool equalxielv(POINT a, POINT b, POINT c, POINT d) {
  return (b.x - a.x == d.x - c.x) && (b.y - a.y == d.y - c.y);
}
bool equallenth(POINT a, POINT b, POINT c, POINT d) {
  return ((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y)) ==
         ((c.x - d.x) * (c.x - d.x) + (c.y - d.y) * (c.y - d.y));
}
bool squre(POINT a, POINT b, POINT c, POINT d) {
  bool ok = true;
  if (equallenth(a, b, d, b) && equallenth(b, d, c, d) &&
      equallenth(a, c, c, d)) {
    if (((b.x - a.x) * (c.x - a.x) + (b.y - a.y) * (c.y - a.y) == 0)) {
      if ((a.x - c.x) * (d.x - c.x) + (a.y - c.y) * (d.y - c.y) == 0) {
        return true;
      }
    }
  }
  return false;
}
bool rectangle(POINT a, POINT b, POINT c, POINT d) {
  bool ok = true;
  if (equallenth(a, b, c, d) && equallenth(b, d, c, a) &&
      ((b.x - a.x) * (c.x - a.x) + (b.y - a.y) * (c.y - a.y) == 0) &&
      ((a.x - c.x) * (d.x - c.x) + (a.y - c.y) * (d.y - c.y) == 0)) {
    return true;
  }
  return false;
}
int main() {
  while (cin >> P[0].x >> P[0].y) {
    for (int i = 1; i < 8; i++) {
      cin >> P[i].x >> P[i].y;
    }
    OK = false;
    int ind[8] = {0, 1, 2, 3, 4, 5, 6, 7};
    do {
      if (squre(P[ind[0]], P[ind[1]], P[ind[2]], P[ind[3]]) &&
          rectangle(P[ind[4]], P[ind[5]], P[ind[6]], P[ind[7]])) {
        OK = true;
        break;
      }
    } while (next_permutation(ind, ind + 8));
    if (OK) {
      cout << "YES\n";
      for (int i = 0; i < 3; i++) {
        cout << ind[i] + 1 << " ";
      }
      cout << ind[3] + 1 << endl;
      for (int i = 4; i < 7; i++) {
        cout << ind[i] + 1 << " ";
      }
      cout << ind[7] + 1 << endl;
    } else {
      cout << "NO\n";
    }
  }
  return 0;
}
