#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x, y;
  void get() { scanf("%d%d", &x, &y); }
  bool friend operator<(Point a, Point b) {
    if (a.x != b.x) return a.x < b.x;
    return a.y < b.y;
  }
};
struct Line {
  Point s, e;
  Line() {}
  Line(Point ss, Point ee) {
    s = ss;
    e = ee;
  }
};
Point pnt[80];
void get_data() {
  int i;
  for (i = 0; i < 8; i++) pnt[i].get();
}
int sq[40], rt[40];
Point s[40], r[40];
int get_dis(Point a, Point b) {
  return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
}
int cc(Point a, Line b) {
  int sx, sy, ex, ey;
  sx = b.s.x - a.x;
  sy = b.s.y - a.y;
  ex = b.e.x - a.x;
  ey = b.e.y - a.y;
  int temp = sx * ey - sy * ex;
  if (temp > 0) return 1;
  if (temp < 0) return -1;
  return 0;
}
int vcc(Point a, Line b) {
  int sx, sy, ex, ey;
  sx = b.s.x - a.x;
  sy = b.s.y - a.y;
  ex = b.e.x - a.x;
  ey = b.e.y - a.y;
  int temp = sx * ey - sy * ex;
  return temp;
}
bool coincide(Line a, Line b) {
  int c[4];
  c[0] = cc(a.s, b);
  c[1] = cc(a.e, b);
  c[2] = cc(b.s, a);
  c[3] = cc(b.e, a);
  if ((c[0] & c[1] & c[2] & c[3]) == 0) return 0;
  return cc(a.s, b) != cc(a.e, b) && cc(b.s, a) != cc(b.e, a);
}
bool init(Point a, Line l[4]) {
  int i, temp = 0;
  for (i = 0; i < 4; i++) temp += vcc(a, l[i]);
  return temp != 0;
}
int aa[4] = {2, 3, 5, 8}, bb[4] = {1, 4, 6, 7};
bool ok() {
  int i, j;
  bool pt = 0;
  for (i = 0; i < 4; i++)
    if (sq[i] != aa[i] - 1) break;
  if (i == 4) pt = 1;
  for (i = 0; i < 4; i++) s[i] = pnt[sq[i]];
  for (i = 0; i < 4; i++) r[i] = pnt[rt[i]];
  sort(s, s + 4);
  sort(r, r + 4);
  int dis[4];
  dis[0] = get_dis(s[0], s[1]);
  dis[1] = get_dis(s[1], s[3]);
  dis[2] = get_dis(s[2], s[3]);
  dis[3] = get_dis(s[2], s[0]);
  if (!dis[0] || !dis[1] || !dis[2] || !dis[3]) return 0;
  if (dis[0] != dis[1] || dis[0] != dis[2] || dis[0] != dis[3]) return 0;
  if ((s[1].x - s[0].x) * (s[2].x - s[0].x) !=
      -(s[2].y - s[0].y) * (s[1].y - s[0].y))
    return 0;
  if ((s[0].x - s[1].x) * (s[3].x - s[1].x) !=
      -(s[3].y - s[1].y) * (s[0].y - s[1].y))
    return 0;
  if ((s[1].x - s[3].x) * (s[2].x - s[3].x) !=
      -(s[2].y - s[3].y) * (s[1].y - s[3].y))
    return 0;
  if ((s[0].x - s[2].x) * (s[3].x - s[2].x) !=
      -(s[3].y - s[2].y) * (s[0].y - s[2].y))
    return 0;
  dis[0] = get_dis(r[0], r[1]);
  dis[1] = get_dis(r[1], r[3]);
  dis[2] = get_dis(r[2], r[3]);
  dis[3] = get_dis(r[2], r[0]);
  if (!dis[0] || !dis[1] || !dis[2] || !dis[3]) return 0;
  if (dis[0] != dis[2] || dis[1] != dis[3]) return 0;
  if ((r[1].x - r[0].x) * (r[2].x - r[0].x) !=
      -(r[2].y - r[0].y) * (r[1].y - r[0].y))
    return 0;
  if ((r[0].x - r[1].x) * (r[3].x - r[1].x) !=
      -(r[3].y - r[1].y) * (r[0].y - r[1].y))
    return 0;
  if ((r[1].x - r[3].x) * (r[2].x - r[3].x) !=
      -(r[2].y - r[3].y) * (r[1].y - r[3].y))
    return 0;
  if ((r[0].x - r[2].x) * (r[3].x - r[2].x) !=
      -(r[3].y - r[2].y) * (r[0].y - r[2].y))
    return 0;
  printf("YES\n");
  for (i = 0; i < 4; i++) {
    printf("%d", sq[i] + 1);
    if (i < 3)
      printf(" ");
    else
      printf("\n");
  }
  for (i = 0; i < 4; i++) {
    printf("%d", rt[i] + 1);
    if (i < 3)
      printf(" ");
    else
      printf("\n");
  }
  return 1;
}
bool dfs(int loc, int ch, int cj) {
  if (loc == 8) {
    return ok();
  }
  int i;
  if (ch < 4) {
    sq[ch] = loc;
    if (dfs(loc + 1, ch + 1, cj)) return 1;
  }
  if (cj < 4) {
    rt[cj] = loc;
    if (dfs(loc + 1, ch, cj + 1)) return 1;
  }
  return 0;
}
void run() {
  if (!dfs(0, 0, 0)) printf("NO\n");
}
int main() {
  get_data();
  run();
  return 0;
}
