#include <bits/stdc++.h>
using namespace std;
const int inf(1010101010);
int x[8], y[8];
int sq(int x) { return x * x; }
int dd(int i, int j) { return sq(x[i] - x[j]) + sq(y[i] - y[j]); }
bool is_square(int a, int b, int c, int d) {
  return dd(a, b) == dd(c, d) && dd(a, d) == dd(b, c) && dd(a, c) == dd(b, d) &&
         dd(a, b) == dd(b, c);
}
bool is_rect(int a, int b, int c, int d) {
  return dd(a, b) == dd(c, d) && dd(a, d) == dd(b, c) && dd(a, c) == dd(b, d);
}
int main() {
  for (int i(0); i < (8); i++) scanf("%d%d", &x[i], &y[i]);
  vector<int> pi(8);
  for (int i(0); i < (8); i++) pi[i] = i;
  do {
    if (is_square(pi[0], pi[1], pi[2], pi[3]) &&
        is_rect(pi[4], pi[5], pi[6], pi[7])) {
      printf("YES\n%d %d %d %d\n%d %d %d %d\n", pi[0] + 1, pi[1] + 1, pi[2] + 1,
             pi[3] + 1, pi[4] + 1, pi[5] + 1, pi[6] + 1, pi[7] + 1);
      return 0;
    }
  } while (next_permutation((pi).begin(), (pi).end()));
  puts("NO");
}
