#include <bits/stdc++.h>
using namespace std;
struct vec {
  int x, y;
  int start, end;
  vector<int> coliniarn;
  vec(int x = 0, int y = 0, int p1 = 0, int p2 = 0)
      : x(x), y(y), start(p1), end(p2) {}
};
int vect(vec &a, vec &b) { return (a.x * b.y - a.y * b.x); }
int scalar(vec &a, vec &b) { return (a.x * b.x + a.y * b.y); }
int length(vec &a) { return (a.x * a.x + a.y * a.y); }
int main() {
  pair<int, int> v[8];
  for (int i = 0; i < 8; i++) {
    cin >> v[i].first >> v[i].second;
  }
  vector<vec> a;
  for (int i = 0; i < 8; i++)
    for (int j = i + 1; j < 8; j++) {
      vec e(v[i].first - v[j].first, v[i].second - v[j].second, i, j);
      a.push_back(e);
    }
  vector<int> square;
  vector<int> rectangle;
  vector<bool> used(8);
  bool found1 = false;
  for (int i = 0; i < a.size() && !found1; i++) {
    for (int j = 0; j < a.size() && !found1; j++) {
      if (i != j) {
        if (!vect(a[i], a[j]) && (length(a[i]) == length(a[j]))) {
          vec t1(v[a[i].start].first - v[a[j].start].first,
                 v[a[i].start].second - v[a[j].start].second, a[i].start,
                 a[j].start);
          vec t2(v[a[i].end].first - v[a[j].end].first,
                 v[a[i].end].second - v[a[j].end].second, a[i].end, a[j].end);
          if (!scalar(a[i], t1) && !scalar(a[i], t2) && !vect(t1, t2) &&
              (length(t1) == length(t2)) && (length(t1) == length(a[i]))) {
            found1 = true;
            used[a[i].start] = true;
            used[a[j].start] = true;
            used[a[i].end] = true;
            used[a[j].end] = true;
            break;
          }
          vec t3(v[a[i].start].first - v[a[j].end].first,
                 v[a[i].start].second - v[a[j].end].second, a[i].start,
                 a[j].end);
          vec t4(v[a[i].end].first - v[a[j].start].first,
                 v[a[i].end].second - v[a[j].start].second, a[i].end,
                 a[j].start);
          if (!scalar(a[i], t3) && !scalar(a[i], t4) && !vect(t3, t4) &&
              (length(t3) == length(t4)) && (length(t3) == length(a[i]))) {
            found1 = true;
            used[a[i].start] = true;
            used[a[j].start] = true;
            used[a[i].end] = true;
            used[a[j].end] = true;
            break;
          }
        }
      }
    }
  }
  if (!found1) {
    cout << "NO" << endl;
    return 0;
  } else {
    found1 = false;
    for (int i = 0; i < a.size() && !found1; i++) {
      for (int j = 0; j < a.size() && !found1; j++) {
        if (i != j) {
          if (!vect(a[i], a[j]) && (length(a[i]) == length(a[j]))) {
            if (!used[a[i].start] && !used[a[j].start] && !used[a[i].end] &&
                !used[a[j].end]) {
              vec t1(v[a[i].start].first - v[a[j].start].first,
                     v[a[i].start].second - v[a[j].start].second, a[i].start,
                     a[j].start);
              vec t2(v[a[i].end].first - v[a[j].end].first,
                     v[a[i].end].second - v[a[j].end].second, a[i].end,
                     a[j].end);
              if (!scalar(a[i], t1) && !scalar(a[i], t2) && !vect(t1, t2) &&
                  (length(t1) == length(t2))) {
                found1 = true;
                used[a[i].start] = false;
                used[a[j].start] = false;
                used[a[i].end] = false;
                used[a[j].end] = false;
              }
              vec t3(v[a[i].start].first - v[a[j].end].first,
                     v[a[i].start].second - v[a[j].end].second, a[i].start,
                     a[j].end);
              vec t4(v[a[i].end].first - v[a[j].start].first,
                     v[a[i].end].second - v[a[j].start].second, a[i].end,
                     a[j].start);
              if (!scalar(a[i], t3) && !scalar(a[i], t4) && !vect(t3, t4) &&
                  (length(t3) == length(t4))) {
                found1 = true;
                used[a[i].start] = false;
                used[a[j].start] = false;
                used[a[i].end] = false;
                used[a[j].end] = false;
              }
            }
          }
        }
      }
    }
    if (!found1) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < 8; i++) {
    if (used[i]) cout << i + 1 << " ";
  }
  cout << endl;
  for (int i = 0; i < 8; i++) {
    if (!used[i]) cout << i + 1 << " ";
  }
  cout << endl;
  return 0;
}
