#include <bits/stdc++.h>
using namespace std;
double eps = 0;
int dot(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  int xa, xb, ya, yb;
  xa = b.first - a.first;
  xb = c.first - b.first;
  ya = b.second - a.second;
  yb = c.second - b.second;
  return (xa * xb + ya * yb);
}
bool r(vector<pair<int, int> > c) {
  return dot(c[0], c[1], c[2]) == 0 && dot(c[1], c[2], c[3]) == 0 &&
         dot(c[2], c[3], c[0]) == 0;
}
double len(pair<int, int> a, pair<int, int> b) {
  double dx = (double)a.first - (double)b.first;
  double dy = (double)a.second - (double)b.second;
  return (double)sqrt(dx * dx + dy * dy);
}
bool s(vector<pair<int, int> > c) {
  int w1 = c[0].first - c[1].first;
  int w2 = c[0].second - c[1].second;
  int w3 = c[2].first - c[1].first;
  int w4 = c[2].second - c[1].second;
  return r(c) && w1 * w1 + w2 * w2 == w3 * w3 + w4 * w4;
}
int main() {
  vector<pair<int, int> > vec(8);
  map<pair<int, int>, int> idx;
  for (int i = 0; i < 8; ++i) {
    scanf("%d %d", &vec[i].first, &vec[i].second);
    idx[vec[i]] = i + 1;
  }
  sort(vec.begin(), vec.end());
  vector<pair<int, int> >::iterator it;
  do {
    vector<pair<int, int> > a, b;
    it = vec.begin();
    for (int j = 0; j < 8; ++j) {
      if (j < 4)
        a.push_back(*it);
      else
        b.push_back(*it);
      ++it;
    }
    if (r(a) and s(b)) {
      printf("YES\n");
      for (it = b.begin(); it != b.end(); ++it) printf("%d ", idx[*it]);
      printf("\n");
      for (it = a.begin(); it != a.end(); ++it) printf("%d ", idx[*it]);
      return 0;
    } else if (r(b) and s(a)) {
      printf("YES\n");
      for (it = a.begin(); it != a.end(); ++it) printf("%d ", idx[*it]);
      printf("\n");
      for (it = b.begin(); it != b.end(); ++it) printf("%d ", idx[*it]);
      return 0;
    }
  } while (next_permutation(vec.begin(), vec.end()));
  printf("NO\n");
  return 0;
}
