#include <bits/stdc++.h>
#pragma comment(linker, "/stack:64000000")
using namespace std;
struct Point {
  int x, y;
  Point() {}
  Point(int x, int y) : x(x), y(y) {}
  Point operator-(Point p) const { return Point(x - p.x, y - p.y); }
};
int scalarProduct(Point a, Point b) { return a.x * b.x + a.y * b.y; }
vector<int> checkAngles(const vector<Point> &p) {
  vector<int> v;
  for (int(i) = 0; (i) < (4); (i)++) v.push_back(i);
  do {
    bool OK = true;
    for (int(i) = 0; (i) < (4); (i)++) {
      Point a(p[v[(i + 1) % 4]] - p[v[i]]);
      Point b(p[v[(i + 2) % 4]] - p[v[(i + 1) % 4]]);
      if (scalarProduct(a, b) != 0) {
        OK = false;
        break;
      }
    }
    if (OK) {
      return v;
    }
  } while (next_permutation((v).begin(), (v).end()));
  return vector<int>();
}
int sqr(int x) { return x * x; }
int sqDist(Point a, Point b) { return sqr(a.x - b.x) + sqr(a.y - b.y); }
bool checkSquare(const vector<Point> &p) {
  vector<int> v = checkAngles(p);
  return !v.empty() && sqDist(p[v[0]], p[v[1]]) != 0 &&
         sqDist(p[v[0]], p[v[1]]) == sqDist(p[v[1]], p[v[2]]) &&
         sqDist(p[v[1]], p[v[2]]) == sqDist(p[v[2]], p[v[3]]) &&
         sqDist(p[v[2]], p[v[3]]) == sqDist(p[v[3]], p[v[0]]);
}
bool checkPolygon(const vector<Point> &p) {
  vector<int> v = checkAngles(p);
  return !v.empty() && sqDist(p[v[0]], p[v[1]]) != 0 &&
         sqDist(p[v[0]], p[v[1]]) == sqDist(p[v[2]], p[v[3]]) &&
         sqDist(p[v[1]], p[v[2]]) == sqDist(p[v[3]], p[v[0]]);
}
int main() {
  const int n = 8;
  vector<Point> v(n);
  for (int(i) = 0; (i) < (n); (i)++) {
    int x, y;
    cin >> x >> y;
    v[i] = Point(x, y);
  }
  for (int(mask) = 0; (mask) < (1 << n); (mask)++) {
    vector<Point> p, q;
    for (int(i) = 0; (i) < (n); (i)++) {
      if (mask & (1 << i)) {
        p.push_back(v[i]);
      } else {
        q.push_back(v[i]);
      }
    }
    if ((int)(p).size() == 4 && checkSquare(p) && checkPolygon(q)) {
      puts("YES");
      for (int(i) = 0; (i) < (n); (i)++) {
        if (mask & (1 << i)) {
          printf("%d ", i + 1);
        }
      }
      printf("\n");
      for (int(i) = 0; (i) < (n); (i)++) {
        if ((mask & (1 << i)) == 0) {
          printf("%d ", i + 1);
        }
      }
      printf("\n");
      return 0;
    }
  }
  puts("NO");
  return 0;
}
