#include <bits/stdc++.h>
using namespace std;
long long p[8];
pair<long long, long long> operator-(pair<long long, long long> a,
                                     pair<long long, long long> b) {
  return {a.first - b.first, a.second - b.second};
}
long long operator*(pair<long long, long long> a,
                    pair<long long, long long> b) {
  return (a.first * b.first + a.second * b.second);
}
vector<pair<long long, long long> > v(8);
pair<long long, long long> get(pair<long long, long long> p1,
                               pair<long long, long long> p2,
                               pair<long long, long long> p3,
                               pair<long long, long long> p4) {
  pair<long long, long long> a = p2 - p1;
  pair<long long, long long> b = p4 - p1;
  if ((p3 - p4) == a && (p3 - p2) == b && (a * b) == 0) {
    return {a * a, b * b};
  }
  return {-1, -1};
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  for (long long i = 0; i < 8; i++) {
    p[i] = i;
    cin >> v[i].first >> v[i].second;
  }
  do {
    pair<long long, long long> a = get(v[p[0]], v[p[1]], v[p[2]], v[p[3]]);
    pair<long long, long long> b = get(v[p[4]], v[p[5]], v[p[6]], v[p[7]]);
    if (a.first != -1 && b.first != -1 && a.first == a.second) {
      cout << "YES" << endl;
      for (long long i = 0; i < 4; i++) {
        cout << ++p[i] << " ";
      }
      cout << endl;
      for (long long i = 0; i < 4; i++) {
        cout << ++p[i + 4] << " ";
      }
      cout << endl;
      return 0;
    }
  } while (next_permutation(p, p + 8));
  cout << "NO";
}
