#include <bits/stdc++.h>
using namespace std;
int n = 8, perm[12];
int dis(pair<int, int> a, pair<int, int> b) {
  return (a.first - b.first) * (a.first - b.first) +
         (a.second - b.second) * (a.second - b.second);
}
bool sqcheck(pair<int, int> a, pair<int, int> b, pair<int, int> c,
             pair<int, int> d) {
  return dis(a, b) == dis(b, c) && dis(b, c) == dis(c, d) &&
         dis(c, d) == dis(d, a) && dis(a, c) == dis(b, d);
}
bool reccheck(pair<int, int> a, pair<int, int> b, pair<int, int> c,
              pair<int, int> d) {
  return dis(a, b) == dis(c, d) && dis(d, a) == dis(c, b) &&
         dis(a, c) == dis(b, d);
}
int main() {
  int i, f = 0;
  pair<int, int> a[12];
  for (i = 1; i <= n; i++) {
    cin >> a[i].first >> a[i].second;
    perm[i] = i;
  }
  do {
    if (sqcheck(a[perm[1]], a[perm[2]], a[perm[3]], a[perm[4]]) &&
        reccheck(a[perm[5]], a[perm[6]], a[perm[7]], a[perm[8]])) {
      f = 1;
      break;
    }
  } while (next_permutation(perm + 1, perm + n + 1));
  if (f) {
    cout << "YES" << endl;
    for (i = 1; i <= 4; i++) {
      if (i > 1) cout << " ";
      cout << perm[i];
    }
    cout << endl;
    for (i = 5; i <= 8; i++) {
      if (i > 5) cout << " ";
      cout << perm[i];
    }
    cout << endl;
  } else
    cout << "NO" << endl;
  return 0;
}
