#include <bits/stdc++.h>
using namespace std;
pair<int, int> coord[8];
int arr[] = {0, 1, 2, 3, 4, 5, 6, 7};
int dist(int i, int j) {
  return (coord[arr[i]].first - coord[arr[j]].first) *
             (coord[arr[i]].first - coord[arr[j]].first) +
         (coord[arr[i]].second - coord[arr[j]].second) *
             (coord[arr[i]].second - coord[arr[j]].second);
}
int main() {
  for (int i = 0; i < 8; i++) {
    cin >> coord[i].first >> coord[i].second;
  }
  while (true) {
    if (dist(0, 1) == dist(1, 2) && dist(1, 2) == dist(2, 3) &&
        dist(2, 3) == dist(3, 0) && dist(0, 2) == dist(1, 3) &&
        dist(4, 5) == dist(6, 7) && dist(4, 7) == dist(5, 6) &&
        dist(4, 6) == dist(5, 7)) {
      cout << "YES" << endl;
      for (int i = 0; i < 8; i++) {
        if (i == 4) cout << endl;
        cout << arr[i] + 1 << " ";
      }
      return 0;
    }
    if (!next_permutation(arr, arr + 8)) {
      break;
    }
  }
  cout << "NO";
  return 0;
}
