#include <bits/stdc++.h>
using namespace std;
class Point {
 public:
  int x, y;
  Point() {}
  Point(int a, int b) : x(a), y(b) {}
  void scan() { scanf("%d%d", &x, &y); }
  void print() { printf("%d %d\n", x, y); }
  Point operator+(Point p) { return Point(x + p.x, y + p.y); }
  Point operator-(Point p) { return Point(x - p.x, y - p.y); }
  bool operator==(Point p) { return x == p.x && y == p.y; }
  int len2() { return x * x + y * y; }
};
Point p[8];
int a[8];
bool isSq(vector<int> t) {
  Point A = p[t[0]];
  Point B = p[t[1]];
  Point C = p[t[2]];
  Point D = p[t[3]];
  Point AC = C - A;
  Point BD = D - B;
  if (AC.len2() == BD.len2()) {
    if (A + C == B + D && (B - A).len2() == (B - C).len2()) return 1;
  }
  Point AB = B - A;
  Point CD = D - C;
  if (AB.len2() == CD.len2()) {
    if (A + B == C + D && (C - A).len2() == (C - B).len2()) return 1;
  }
  Point AD = D - A;
  Point BC = C - B;
  if (AD.len2() == BC.len2()) {
    if (A + D == C + B && (C - D).len2() == (D - B).len2()) return 1;
  }
  return 0;
}
bool isRec(vector<int> t) {
  Point A = p[t[0]];
  Point B = p[t[1]];
  Point C = p[t[2]];
  Point D = p[t[3]];
  Point AC = C - A;
  Point BD = D - B;
  if (AC.len2() == BD.len2()) {
    if (A + C == B + D) return 1;
  }
  Point AB = B - A;
  Point CD = D - C;
  if (AB.len2() == CD.len2()) {
    if (A + B == C + D) return 1;
  }
  Point AD = D - A;
  Point BC = C - B;
  if (AD.len2() == BC.len2()) {
    if (A + D == C + B) return 1;
  }
  return 0;
}
int main() {
  for (int i = 0; i < 8; i++) p[i].scan();
  for (int i = 0; i < 4; i++) a[i] = 0;
  for (int i = 4; i < 8; i++) a[i] = 1;
  vector<int> t1, t2;
  do {
    t1.clear();
    t2.clear();
    for (int i = 0; i < 8; i++) {
      if (a[i])
        t1.push_back(i);
      else
        t2.push_back(i);
    }
    if (isSq(t1) && isRec(t2)) {
      printf("YES\n");
      for (int i = 0; i < 4; i++) printf("%d ", t1[i] + 1);
      printf("\n");
      for (int i = 0; i < 4; i++) printf("%d ", t2[i] + 1);
      return 0;
    }
  } while (next_permutation(a, a + 8));
  printf("NO");
  return 0;
}
