#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
int pos[] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
struct node {
  int x;
  int y;
} a[9];
int dis(int i, int j) {
  i = pos[i];
  j = pos[j];
  return (a[i].x - a[j].x) * (a[i].x - a[j].x) +
         (a[i].y - a[j].y) * (a[i].y - a[j].y);
}
int main() {
  {
    for (int i = 1; i < 9; i++) cin >> a[i].x >> a[i].y;
    do {
      if (dis(1, 2) == dis(2, 3) && dis(2, 3) == dis(3, 4) &&
          dis(3, 4) == dis(4, 1) && dis(1, 3) == dis(2, 4)) {
        if (dis(5, 6) == dis(7, 8) && dis(6, 7) == dis(5, 8) &&
            dis(5, 7) == dis(6, 8)) {
          cout << "YES" << endl;
          cout << pos[1] << " " << pos[2] << " " << pos[3] << " " << pos[4]
               << endl;
          cout << pos[5] << " " << pos[6] << " " << pos[7] << " " << pos[8]
               << endl;
          return 0;
        }
      }
    } while (next_permutation(pos + 1, pos + 9));
    cout << "NO" << endl;
    cout << '\n';
  }
  return 0;
}
