#include <bits/stdc++.h>
using namespace std;
int p[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
int x[10], y[10], flag;
int dist(int a, int b) {
  return ((x[p[a]] - x[p[b]]) * (x[p[a]] - x[p[b]]) +
          (y[p[a]] - y[p[b]]) * (y[p[a]] - y[p[b]]));
}
int main() {
  for (int i = 1; i < 9; i++) {
    cin >> x[i] >> y[i];
  }
  do {
    if (dist(1, 2) == dist(2, 3) && dist(2, 3) == dist(3, 4) &&
        dist(3, 4) == dist(4, 1) && dist(1, 3) == dist(2, 4) &&
        dist(5, 6) == dist(7, 8) && dist(6, 7) == dist(5, 8) &&
        dist(5, 7) == dist(6, 8)) {
      if (flag == 0)
        cout << "YES" << endl
             << p[1] << ' ' << p[2] << ' ' << p[3] << ' ' << p[4] << endl
             << p[5] << ' ' << p[6] << ' ' << p[7] << ' ' << p[8] << endl;
      ;
      flag = 1;
    }
  } while (next_permutation(p + 1, p + 9));
  if (flag == 0) cout << "NO" << endl;
  return 0;
}
