#include <bits/stdc++.h>
using namespace std;
complex<double> ps[8];
int pm[8] = {0, 1, 2, 3, 4, 5, 6, 7};
inline double inp(const complex<double>& a, const complex<double>& b) {
  return (conj(a) * b).real();
}
const double EPS = 1e-8;
int main(void) {
  for (int i = 0; i < (int)(8); ++i) {
    double x, y;
    cin >> x >> y;
    ps[i] = complex<double>(x, y);
  }
  bool ok = false;
  do {
    ok = true;
    for (int i = 0; i < (int)(4); ++i) {
      complex<double> a = ps[pm[i]] - ps[pm[(i + 1) % 4]];
      complex<double> b = ps[pm[(i + 1) % 4]] - ps[pm[(i + 2) % 4]];
      if (!(abs(abs(a) - abs(b)) < EPS && abs(inp(a, b)) < EPS)) {
        ok = false;
      }
    }
    for (int i = 0; i < (int)(4); ++i) {
      complex<double> a = ps[pm[i + 4]] - ps[pm[(i + 1) % 4 + 4]];
      complex<double> b = ps[pm[(i + 1) % 4 + 4]] - ps[pm[(i + 2) % 4 + 4]];
      if (!(abs(inp(a, b)) < EPS)) {
        ok = false;
      }
    }
    if (ok) break;
  } while (next_permutation(pm, pm + 8));
  if (ok) {
    cout << "YES" << endl;
    cout << pm[0] + 1 << " " << pm[1] + 1 << " " << pm[2] + 1 << " "
         << pm[3] + 1 << endl;
    cout << pm[4] + 1 << " " << pm[5] + 1 << " " << pm[6] + 1 << " "
         << pm[7] + 1 << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
