#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1E-9;
const int INF = (int)1E9;
const long long INF64 = (long long)1E18;
const long double PI = 2 * acos(.0);
struct point {
  int x, y;
};
point points[10];
int IsOrthogonal(point a, point b, point c) {
  return (b.x - a.x) * (b.x - c.x) + (b.y - a.y) * (b.y - c.y) == 0;
}
int IsRectangle(point a, point b, point c, point d) {
  return IsOrthogonal(a, b, c) && IsOrthogonal(b, c, d) &&
         IsOrthogonal(c, d, a);
}
bool IsRectangleAnyOrder(point a, point b, point c, point d) {
  return IsRectangle(a, b, c, d) || IsRectangle(b, c, a, d) ||
         IsRectangle(c, a, b, d);
}
bool isSquare(point a, point b, point c, point d) {
  long long d1 = (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
  long long d2 = (b.x - c.x) * (b.x - c.x) + (b.y - c.y) * (b.y - c.y);
  long long d3 = (c.x - d.x) * (c.x - d.x) + (c.y - d.y) * (c.y - d.y);
  long long d4 = (a.x - d.x) * (a.x - d.x) + (a.y - d.y) * (a.y - d.y);
  if (d1 == d2 && d2 == d3 && d3 == d4 && d4 == d1) return 1;
  return 0;
}
bool isSAny(point a, point b, point c, point d) {
  if (!IsRectangleAnyOrder(a, b, c, d)) return 0;
  return isSquare(a, b, c, d) || isSquare(b, c, a, d) || isSquare(c, a, b, d);
}
int main() {
  for (int i = 0; i < (int)(8); i++) cin >> points[i].x >> points[i].y;
  vector<int> pp;
  for (int i = 0; i < (int)(8); i++) pp.push_back(i);
  int r[4], s[4];
  bool cent = 0;
  for (int i = 0; i < (int)((1 << 8)); i++) {
    if (__builtin_popcount(i) != 4) continue;
    vector<int> pA, pB;
    for (int j = 0; j < (int)(8); j++) {
      if (i & (1 << j)) {
        pA.push_back(j);
      } else
        pB.push_back(j);
    }
    if (isSAny(points[pA[0]], points[pA[1]], points[pA[2]], points[pA[3]])) {
      for (int i = 0; i < (int)(4); i++) {
        r[i] = pA[i] + 1;
      }
      if (IsRectangleAnyOrder(points[pB[0]], points[pB[1]], points[pB[2]],
                              points[pB[3]])) {
        for (int i = 0; i < (int)(4); i++) {
          s[i] = pB[i] + 1;
        }
        cent = 1;
        break;
      }
    }
  }
  if (!cent)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    for (int i = 0; i < (int)(4); i++) cout << r[i] << " ";
    cout << endl;
    for (int i = 0; i < (int)(4); i++) cout << s[i] << " ";
    cout << endl;
  }
  return 0;
}
