#include <bits/stdc++.h>
using namespace std;
typedef struct {
  int x, y;
} point;
vector<point> 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);
}
bool checkSquare(point a, point b, point c, point d) {
  bool ret = true;
  ret &= (dist(a, b) == dist(b, c));
  ret &= (dist(a, b) == dist(c, d));
  ret &= (dist(a, b) == dist(a, d));
  ret &= ((dist(a, b) + dist(b, c)) == dist(a, c));
  return ret;
}
bool checkRectangle(point a, point b, point c, point d) {
  bool ret = true;
  ret &= (dist(a, b) == dist(c, d));
  ret &= (dist(a, d) == dist(b, c));
  ret &= ((dist(a, b) + dist(b, c)) == dist(a, c));
  ret &= ((dist(b, c) + dist(c, d)) == dist(b, d));
  return ret;
}
int main() {
  vector<int> perm(8);
  for (int i = 0; i < 8; i++) {
    cin >> a[i].x >> a[i].y;
    perm[i] = i;
  }
  do {
    if (checkSquare(a[perm[0]], a[perm[1]], a[perm[2]], a[perm[3]]) and
        checkRectangle(a[perm[4]], a[perm[5]], a[perm[6]], a[perm[7]])) {
      puts("YES");
      cout << perm[0] + 1 << " " << perm[1] + 1 << " " << perm[2] + 1 << " "
           << perm[3] + 1 << endl;
      cout << perm[4] + 1 << " " << perm[5] + 1 << " " << perm[6] + 1 << " "
           << perm[7] + 1 << endl;
      return 0;
    }
  } while (next_permutation(perm.begin(), perm.end()));
  puts("NO");
  return 0;
}
