#include <bits/stdc++.h>
using namespace std;
typedef struct {
  int x;
  int y;
  int n;
} T1;
vector<T1> V(8);
bool operator<(const T1& a, const T1& b) {
  return (make_pair(make_pair(a.x, a.y), a.n) <
          make_pair(make_pair(b.x, b.y), b.n));
}
bool isSquare() {
  pair<int, int> P[4];
  for (int i = 0; i < 4; i++) {
    P[i].first = V[i].x;
    P[i].second = V[i].y;
  }
  vector<double> tmp;
  for (int i1 = 0; i1 < 4; i1++)
    for (int j1 = i1 + 1; j1 < 4; j1++)
      tmp.push_back(
          hypot(P[i1].first - P[j1].first, P[i1].second - P[j1].second));
  sort(tmp.begin(), tmp.end());
  bool res = true;
  for (int i = 1; i < 4; i++) res = res && (abs(tmp[0] - tmp[i]) < 0.0001);
  res = res && (abs(tmp[4] - tmp[5]) < 0.0001);
  return (res);
}
bool isRect() {
  pair<int, int> P[4];
  for (int i = 0; i < 4; i++) {
    P[i].first = V[i + 4].x;
    P[i].second = V[i + 4].y;
  }
  bool res = true;
  for (int i1 = 0; i1 < 4; i1++)
    for (int j1 = i1 + 1; j1 < 4; j1++)
      for (int i2 = 0; i2 < 4; i2++)
        for (int j2 = i2 + 1; j2 < 4; j2++) {
          if (i1 != i2 && i1 != j2 && j1 != i2 && j1 != j2)
            res = res && (abs(hypot(P[i1].first - P[j1].first,
                                    P[i1].second - P[j1].second) -
                              hypot(P[i2].first - P[j2].first,
                                    P[i2].second - P[j2].second)) < 0.0001);
        }
  return (res);
}
bool check() { return (isSquare() && isRect()); }
int main() {
  for (int i = 0; i < 8; i++) {
    cin >> V[i].x >> V[i].y;
    V[i].n = i + 1;
  }
  sort(V.begin(), V.end());
  do {
    if (check()) {
      cout << "YES" << endl;
      for (int i = 0; i < 4; i++) cout << V[i].n << " ";
      cout << endl;
      for (int i = 4; i < 8; i++) cout << V[i].n << " ";
      goto exit;
    }
  } while (next_permutation(V.begin(), V.end()));
  cout << "NO";
exit:
  return (0);
}
