#include <bits/stdc++.h>
using namespace std;
static const int INF = 500000000;
template <class T>
void debug(T a, T b) {
  for (; a != b; ++a) cerr << *a << ' ';
  cerr << endl;
}
pair<int, int> p[10];
pair<int, int> decr(pair<int, int> a, pair<int, int> b) {
  return make_pair(a.first - b.first, a.second - b.second);
}
int dot(pair<int, int> a, pair<int, int> b) {
  return a.first * b.first + a.second * b.second;
}
int len(pair<int, int> a, pair<int, int> b) {
  pair<int, int> d = decr(a, b);
  return d.first * d.first + d.second * d.second;
}
bool isrect(pair<int, int>* a) {
  sort(a, a + 4);
  do {
    if (len(a[0], a[1]) > 0 && len(a[1], a[2]) > 0 &&
        dot(decr(a[1], a[0]), decr(a[3], a[0])) == 0 &&
        dot(decr(a[2], a[1]), decr(a[0], a[1])) == 0 &&
        dot(decr(a[3], a[2]), decr(a[1], a[2])) == 0)
      return true;
  } while (next_permutation(a, a + 4));
  return false;
}
bool issqar(pair<int, int>* a) {
  sort(a, a + 4);
  do {
    if (len(a[0], a[1]) == len(a[1], a[2]) &&
        len(a[1], a[2]) == len(a[2], a[3]) &&
        len(a[2], a[3]) == len(a[3], a[0]) &&
        dot(decr(a[1], a[0]), decr(a[3], a[0])) == 0 &&
        dot(decr(a[2], a[1]), decr(a[0], a[1])) == 0 &&
        dot(decr(a[3], a[2]), decr(a[1], a[2])) == 0)
      return true;
  } while (next_permutation(a, a + 4));
  return false;
}
int main() {
  for (int i = 0; i < 8; ++i) cin >> p[i].first >> p[i].second;
  for (int i = 0; i < 1 << 8; ++i)
    if (__builtin_popcount(i) == 4) {
      pair<int, int> a[4], b[4];
      int n = 0, m = 0;
      for (int j = 0; j < 8; ++j) {
        if (i >> j & 1)
          a[n++] = p[j];
        else
          b[m++] = p[j];
      }
      if (isrect(a) && issqar(b)) {
        puts("YES");
        for (int j = 0; j < 8; ++j)
          if (!(i >> j & 1)) printf("%d ", j + 1);
        putchar('\n');
        for (int j = 0; j < 8; ++j)
          if (i >> j & 1) printf("%d ", j + 1);
        putchar('\n');
        return 0;
      }
    }
  puts("NO");
  return 0;
}
