#include <bits/stdc++.h>
using namespace std;
struct point {
  int x, y;
  long KC(const point &a) {
    return (x - a.x) * (x - a.x) + (y - a.y) * (y - a.y);
  }
};
point mang[10];
int A[] = {0, 1, 2, 3, 4, 5, 6, 7};
bool IsVuong(point a, point b, point c, point d) {
  long kc1 = a.KC(b), kc2 = a.KC(c), kc3 = a.KC(d);
  if (kc1 == kc2 && kc1 + kc2 == kc3 && d.KC(b) == d.KC(c)) return true;
  if (kc1 == kc3 && kc1 + kc3 == kc2 && c.KC(b) == c.KC(d)) return true;
  if (kc2 == kc3 && kc2 + kc3 == kc1 && b.KC(c) == b.KC(d)) return true;
  return false;
}
bool IsCN(point a, point b, point c, point d) {
  long kc1 = a.KC(b), kc2 = a.KC(c), kc3 = a.KC(d);
  if (kc1 + kc2 == kc3 && (d.KC(c) + d.KC(b) == kc3)) return true;
  if (kc1 + kc3 == kc2 && (c.KC(b) + c.KC(d) == kc2)) return true;
  if (kc2 + kc3 == kc1 && (b.KC(d) + b.KC(c) == kc1)) return true;
  return false;
}
int main() {
  int i;
  for (i = 0; i < 8; i++) cin >> mang[i].x >> mang[i].y;
  bool ok = 0;
  do {
    if (IsVuong(mang[A[0]], mang[A[1]], mang[A[2]], mang[A[3]]) &&
        IsCN(mang[A[4]], mang[A[5]], mang[A[6]], mang[A[7]])) {
      cout << "YES" << endl;
      cout << A[0] + 1 << " " << A[1] + 1 << " " << A[2] + 1 << " " << A[3] + 1
           << endl;
      cout << A[4] + 1 << " " << A[5] + 1 << " " << A[6] + 1 << " " << A[7] + 1
           << endl;
      ok = 1;
      break;
    }
  } while (next_permutation(A, A + 8));
  if (!ok) cout << "NO";
}
