#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const int prime = 9241;
struct point {
  int x, y;
  point() {}
  point(int x, int y) : x(x), y(y) {}
};
int dst(point a, point b) {
  return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
}
int main() {
  vector<point> p(8);
  for (int i = 0; i < 8; i++) cin >> p[i].x >> p[i].y;
  vector<int> perm(8);
  for (int i = 0; i < 8; i++) perm[i] = i;
  do {
    int a[4][4], b[4][4];
    for (int i = 0; i < 4; i++)
      for (int j = 0; j < 4; j++)
        a[i][j] = dst(p[perm[i]], p[perm[j]]),
        b[i][j] = dst(p[perm[i + 4]], p[perm[j + 4]]);
    if (a[0][1] != a[0][2] || a[0][1] != a[1][3] || a[0][1] != a[2][3] ||
        a[0][3] != a[0][1] + a[1][3])
      continue;
    if (b[0][1] != b[2][3] || b[1][3] != b[0][2] ||
        b[0][3] != b[0][1] + b[1][3] || b[1][2] != b[0][1] + b[0][2])
      continue;
    cout << "YES" << endl;
    for (int i = 0; i < 4; i++) cout << perm[i] + 1 << ' ';
    cout << endl;
    for (int i = 0; i < 4; i++) cout << perm[i + 4] + 1 << ' ';
    cout << endl;
    return 0;
  } while (next_permutation(perm.begin(), perm.end()));
  cout << "NO";
}
