#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x, y;
  void read() { scanf("%d%d", &x, &y); }
  bool operator<(const Point &a) const {
    return x < a.x || (x == a.x && y == a.y);
  }
};
Point operator-(Point a, Point b) {
  Point c;
  c.x = a.x - b.x;
  c.y = a.y - b.y;
  return c;
}
int cross(Point a, Point b) { return a.x * b.y - a.y * b.x; }
int dot(Point a, Point b) { return a.x * b.x + a.y * b.y; }
int length2(Point a) { return dot(a, a); }
int ok(Point a, Point b, Point c, Point d) {
  if (cross(a - b, c - d) == 0 && length2(a - b) != 0 &&
      cross(a - c, b - d) == 0 && length2(a - c) != 0 &&
      dot(a - b, a - c) == 0) {
    if (length2(a - b) == length2(a - c))
      return 2;
    else
      return 1;
  }
  return 0;
}
int shape(Point a, Point b, Point c, Point d) {
  Point p[4] = {a, b, c, d};
  int ans = 0;
  do {
    int d = ok(p[0], p[1], p[2], p[3]);
    ans = max(ans, d);
  } while (next_permutation(p, p + 4));
  return ans;
}
Point p[8];
int k[8];
int main() {
  for (int i = 0; i < 8; i++) p[i].read();
  bool flag = false;
  for (int i = 0; i < 8; i++) k[i] = i;
  do {
    if (shape(p[k[0]], p[k[1]], p[k[2]], p[k[3]]) == 2 &&
        shape(p[k[4]], p[k[5]], p[k[6]], p[k[7]]) >= 1) {
      flag = true;
      break;
    }
  } while (next_permutation(k, k + 8));
  if (flag) {
    puts("YES");
    for (int i = 0; i < 4; i++) printf("%d ", k[i] + 1);
    puts("");
    for (int i = 4; i < 8; i++) printf("%d ", k[i] + 1);
  } else
    puts("NO");
  return 0;
}
