#include <bits/stdc++.h>
using namespace std;
struct Coo {
  int x, y;
};
int distsq(Coo a, Coo b) {
  return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
}
bool is_rectangle(Coo a, Coo b, Coo c, Coo d) {
  Coo v1, v2, v3, v4;
  v1.x = b.x - a.x;
  v1.y = b.y - a.y;
  v2.x = c.x - b.x;
  v2.y = c.y - b.y;
  v3.x = d.x - c.x;
  v3.y = d.y - c.y;
  v4.x = a.x - d.x;
  v4.y = a.y - d.y;
  return v1.x * v2.x + v1.y * v2.y == 0 && v2.x * v3.x + v2.y * v3.y == 0 &&
         v3.x * v4.x + v3.y * v4.y == 0 && v4.x * v1.x + v4.y * v1.y == 0;
}
bool is_square(Coo a, Coo b, Coo c, Coo d) {
  int distsq1 = distsq(a, b);
  int distsq2 = distsq(b, c);
  int distsq3 = distsq(c, d);
  int distsq4 = distsq(d, a);
  return is_rectangle(a, b, c, d) && distsq1 == distsq2 && distsq1 == distsq3 &&
         distsq1 == distsq4;
}
int main() {
  Coo coo[8];
  bool solved = false;
  for (int i = 0; i < 8; i++) cin >> coo[i].x >> coo[i].y;
  int permutation[8];
  for (int i = 0; i < 8; i++) permutation[i] = i;
  do {
    solved = is_square(coo[permutation[0]], coo[permutation[1]],
                       coo[permutation[2]], coo[permutation[3]]) &&
             is_rectangle(coo[permutation[4]], coo[permutation[5]],
                          coo[permutation[6]], coo[permutation[7]]);
  } while (solved == false && next_permutation(permutation, permutation + 8));
  if (solved) {
    cout << "YES" << endl;
    int i;
    for (i = 0; i < 3; i++) cout << permutation[i] + 1 << ' ';
    cout << permutation[i] + 1 << endl;
    for (i++; i < 7; i++) cout << permutation[i] + 1 << ' ';
    cout << permutation[i] + 1 << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
