#include <bits/stdc++.h>
using namespace std;
int x[10], y[10];
struct point {
  int x, y, id;
  bool operator<(const point& o) const { return id < o.id; }
  point operator-(const point& o) const { return {x - o.x, y - o.y}; }
} a[8];
int dist(point a, point b) {
  return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
}
int dot(point a, point b) { return a.x * b.x + a.y * b.y; }
bool orto(point a, point b, point c) { return (dot(a - b, c - b) == 0); }
bool rec(point a, point b, point c, point d) {
  return (orto(a, b, c) && orto(b, c, d) && orto(c, d, a) && orto(d, a, b));
}
bool sq(point a, point b, point c, point d) {
  return (rec(a, b, c, d) && dist(a, b) == dist(b, c));
}
void Solve() {
  for (int i = 0; i < 8; i++) {
    cin >> a[i].x >> a[i].y;
    a[i].id = i + 1;
  }
  do {
    if (sq(a[0], a[1], a[2], a[3]) && rec(a[4], a[5], a[6], a[7])) {
      cout << "YES\n";
      for (int i = 0; i < 4; i++) cout << a[i].id << " ";
      cout << "\n";
      for (int i = 4; i < 8; i++) cout << a[i].id << " ";
      return;
    }
  } while (next_permutation(a, a + 8));
  cout << "NO\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int tt = 1;
  while (tt--) Solve();
  return 0;
}
