#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > v;
int A[10];
int dis(int i, int j) {
  return (v[A[i]].second - v[A[j]].second) * (v[A[i]].second - v[A[j]].second) +
         (v[A[i]].first - v[A[j]].first) * (v[A[i]].first - v[A[j]].first);
}
inline bool isRec() {
  bool f1 =
      ((v[A[4]].second - v[A[3]].second) * (v[A[2]].first - v[A[1]].first) ==
       (v[A[2]].second - v[A[1]].second) * (v[A[4]].first - v[A[3]].first));
  bool f2 = (dis(1, 2) == dis(3, 4));
  bool f3 =
      ((v[A[2]].second - v[A[1]].second) * (v[A[3]].second - v[A[1]].second) ==
       -(v[A[2]].first - v[A[1]].first) * (v[A[3]].first - v[A[1]].first));
  bool f4 =
      ((v[A[2]].second - v[A[4]].second) * (v[A[3]].second - v[A[4]].second) ==
       -(v[A[2]].first - v[A[4]].first) * (v[A[3]].first - v[A[4]].first));
  return (f1 && f2 && f3 && f4);
}
inline bool isSqr() {
  bool f1 =
      ((v[A[8]].second - v[A[7]].second) * (v[A[6]].first - v[A[5]].first) ==
       (v[A[6]].second - v[A[5]].second) * (v[A[8]].first - v[A[7]].first));
  bool f2 = (dis(5, 6) == dis(6, 8) && dis(6, 8) == dis(8, 7) &&
             dis(8, 7) == dis(7, 5));
  bool f3 =
      ((v[A[6]].second - v[A[5]].second) * (v[A[7]].second - v[A[5]].second) ==
       -(v[A[6]].first - v[A[5]].first) * (v[A[7]].first - v[A[5]].first));
  return (f1 && f2 && f3);
}
int main() {
  v.resize(9);
  for (int i = 1; i <= 8; i++) {
    cin >> v[i].first >> v[i].second;
  }
  for (int i = 1; i <= 8; i++) {
    A[i] = i;
  }
  do {
    if (isRec() && isSqr()) {
      cout << "YES" << endl;
      for (int i = 5; i <= 8; i++) {
        printf("%d ", A[i]);
      }
      cout << endl;
      for (int i = 1; i <= 4; i++) {
        printf("%d ", A[i]);
      }
      cout << endl;
      return 0;
    }
  } while (next_permutation(A + 1, A + 9));
  cout << "NO" << endl;
}
