#include <bits/stdc++.h>
bool rc(int a, int b, int c, int d);
using namespace std;
struct p {
  int x;
  int y;
};
p k[8];
bool kv(int a, int b, int c, int d) {
  if (rc(a, b, c, d) && ((k[a].x - k[b].x) * (k[a].x - k[b].x) +
                             (k[a].y - k[b].y) * (k[a].y - k[b].y) ==
                         (k[c].x - k[b].x) * (k[c].x - k[b].x) +
                             (k[c].y - k[b].y) * (k[c].y - k[b].y)))
    return true;
  return false;
}
bool rc(int a, int b, int c, int d) {
  if ((k[a].x - k[b].x) * (k[b].x - k[c].x) +
          (k[a].y - k[b].y) * (k[b].y - k[c].y) !=
      0)
    return false;
  if ((k[b].x - k[c].x) * (k[c].x - k[d].x) +
          (k[b].y - k[c].y) * (k[c].y - k[d].y) !=
      0)
    return false;
  if ((k[c].x - k[d].x) * (k[d].x - k[a].x) +
          (k[c].y - k[d].y) * (k[d].y - k[a].y) !=
      0)
    return false;
  if ((k[d].x - k[a].x) * (k[a].x - k[b].x) +
          (k[d].y - k[a].y) * (k[a].y - k[b].y) !=
      0)
    return false;
  return true;
}
int main() {
  for (int i = 0; i < 8; i++) {
    int w, e;
    cin >> w >> e;
    k[i].x = w;
    k[i].y = e;
  }
  int a[8] = {0, 1, 2, 3, 4, 5, 6, 7};
  do {
    if (kv(a[0], a[1], a[2], a[3]) && rc(a[4], a[5], a[6], a[7])) {
      cout << "YES" << endl;
      cout << a[0] + 1 << " " << a[1] + 1 << " " << a[2] + 1 << " " << a[3] + 1
           << endl;
      cout << a[4] + 1 << " " << a[5] + 1 << " " << a[6] + 1 << " " << a[7] + 1
           << endl;
      return 0;
    }
  } while (next_permutation(a, a + 8));
  cout << "NO" << endl;
}
