#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > p;
int sqr(int x) { return x * x; }
int dist(int i, int j) {
  return sqr(p[i].first - p[j].first) + sqr(p[i].second - p[j].second);
}
bool norm(int i, int j, int k) {
  return ((p[j].first - p[i].first) * (p[k].first - p[j].first) +
          (p[j].second - p[i].second) * (p[k].second - p[j].second)) == 0;
}
bool check(vector<int>& ind) {
  for (int i = 0; i < 4; ++i) {
    if (!norm(ind[i], ind[(i + 1) % 4], ind[(i + 2) % 4])) {
      return false;
    }
    if (!norm(ind[i + 4], ind[(i + 1) % 4 + 4], ind[(i + 2) % 4 + 4])) {
      return false;
    }
  }
  int d = dist(ind[0], ind[1]);
  if (d != dist(ind[1], ind[2]) || d != dist(ind[2], ind[3]) ||
      d != dist(ind[3], ind[0])) {
    return false;
  }
  return true;
}
int main() {
  p.resize(8);
  for (int i = 0; i < 8; ++i) cin >> p[i].first >> p[i].second;
  vector<int> ind(8);
  for (int i = 0; i < 8; ++i) ind[i] = i;
  do {
    if (check(ind)) {
      cout << "YES\n";
      for (int i = 0; i < 4; ++i) cout << ind[i] + 1 << " ";
      cout << "\n";
      for (int i = 4; i < 8; ++i) cout << ind[i] + 1 << " ";
      return 0;
    }
  } while (next_permutation(ind.begin(), ind.end()));
  cout << "NO";
  return 0;
}
