#include <bits/stdc++.h>
using namespace std;
pair<int, int> pp[10];
pair<int, int> pt[10];
long long dist(pair<int, int> a, pair<int, int> b) {
  return ((long long)(a.first - b.first) * (long long)(a.first - b.first)) +
         ((long long)(a.second - b.second) * (long long)(a.second - b.second));
}
bool chkSQ(pair<int, int> a, pair<int, int> b, pair<int, int> c,
           pair<int, int> d) {
  set<long long> st;
  st.insert(dist(a, b));
  st.insert(dist(a, c));
  st.insert(dist(a, d));
  st.insert(dist(b, c));
  st.insert(dist(b, d));
  st.insert(dist(c, d));
  vector<long long> v(st.begin(), st.end());
  int sz = v.size();
  if (sz != 2) return false;
  if (2 * v[0] != v[1]) return false;
  return true;
}
bool chkRE(pair<int, int> a, pair<int, int> b, pair<int, int> c,
           pair<int, int> d) {
  pt[0] = a;
  pt[1] = b;
  pt[2] = c;
  pt[3] = d;
  vector<int> v;
  int i;
  for (i = 0; i <= 3; i++) v.push_back(i);
  do {
    if (dist(pt[v[0]], pt[v[1]]) == dist(pt[v[2]], pt[v[3]]) &&
        dist(pt[v[0]], pt[v[2]]) == dist(pt[v[1]], pt[v[3]]) &&
        dist(pt[v[0]], pt[v[3]]) == dist(pt[v[2]], pt[v[1]]))
      return true;
  } while (next_permutation(v.begin(), v.end()));
  return false;
}
int main() {
  int i, j, k, x, y;
  for (i = 0; i <= 7; i++) {
    scanf("%d%d", &x, &y);
    pp[i] = pair<int, int>(x, y);
  }
  vector<int> id;
  for (i = 0; i <= 7; i++) id.push_back(i);
  do {
    if (chkSQ(pp[id[0]], pp[id[1]], pp[id[2]], pp[id[3]]) &&
        chkRE(pp[id[4]], pp[id[5]], pp[id[6]], pp[id[7]])) {
      puts("YES");
      for (i = 0; i <= 3; i++) printf("%d%c", id[i] + 1, (i == 3) ? '\n' : ' ');
      for (i = 4; i <= 7; i++) printf("%d%c", id[i] + 1, (i == 7) ? '\n' : ' ');
      return 0;
    }
  } while (next_permutation(id.begin(), id.end()));
  puts("NO");
  return 0;
}
