#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x, y;
};
Point p[8];
int ind[8];
Point vect(Point a, Point b) {
  Point res;
  res.x = b.x - a.x;
  res.y = b.y - a.y;
  return res;
}
int product(Point a, Point b, Point c) {
  Point u = vect(a, b);
  Point v = vect(b, c);
  return u.x * v.x + u.y * v.y;
}
bool four(Point a, Point b, Point c, Point d) {
  return !product(a, b, c) && !product(b, c, d) && !product(c, d, a) &&
         !product(d, a, b);
}
int len2(Point v) { return v.x * v.x + v.y * v.y; }
bool square(Point a, Point b, Point c, Point d) {
  return four(a, b, c, d) && (len2(vect(a, b)) == len2(vect(b, c)));
}
int main() {
  for (int i = 0; i < 8; i++) {
    ind[i] = i;
  }
  for (int i = 0; i < 8; i++) {
    cin >> p[i].x >> p[i].y;
  }
  do {
    if (square(p[ind[0]], p[ind[1]], p[ind[2]], p[ind[3]]) &&
        four(p[ind[4]], p[ind[5]], p[ind[6]], p[ind[7]])) {
      cout << "YES\n";
      for (int i = 0; i < 4; i++) {
        cout << ind[i] + 1 << " ";
      }
      cout << endl;
      for (int i = 4; i < 8; i++) {
        cout << ind[i] + 1 << " ";
      }
      return 0;
    }
  } while (next_permutation(ind, ind + 8));
  cout << "NO";
  return 0;
}
