#include <bits/stdc++.h>
using namespace std;
struct point {
  int x, y;
};
point p[16];
int a[8];
int dot(point o, point p, point q) {
  return (o.x - p.x) * (o.x - q.x) + (o.y - q.y) * (o.y - p.y);
}
int dist(point p, point q) {
  return (p.x - q.x) * (p.x - q.x) + (p.y - q.y) * (p.y - q.y);
}
bool check() {
  int i;
  for (i = 0; i < 4; i++) {
    if ((dot(p[a[i]], p[a[(i + 4 - 1) % 4]], p[a[(i + 1) % 4]]))) {
      return false;
    }
  }
  if (dist(p[a[0]], p[a[1]]) != dist(p[a[1]], p[a[2]])) return false;
  for (i = 0; i < 4; i++) {
    if ((dot(p[a[i + 4]], p[a[(i + 4 - 1) % 4 + 4]], p[a[(i + 1) % 4 + 4]]))) {
      return false;
    }
  }
  return true;
}
int main() {
  int i;
  for ((i) = 0; (i) < (8); (i)++) {
    cin >> p[i].x >> p[i].y;
  }
  for ((i) = 0; (i) < (8); (i)++) a[i] = i;
  do {
    if (check()) {
      cout << "YES" << endl;
      for (i = 0; i < 4; i++) cout << a[i] + 1 << " ";
      cout << endl;
      for (i = 4; i < 8; i++) cout << a[i] + 1 << " ";
      cout << endl;
      return 0;
    }
  } while (next_permutation(a, a + 8));
  cout << "NO" << endl;
  return 0;
}
