#include <bits/stdc++.h>
#pragma comment(linker, "/stack:32000000")
using namespace std;
struct Point {
  int x;
  int y;
};
Point p;
vector<Point> a;
vector<int> indeces;
bool normalize(int first, int second, int third) {
  return ((a[second].x - a[first].x) * (a[third].x - a[second].x) +
          (a[second].y - a[first].y) * (a[third].y - a[second].y)) == 0;
}
int sqr(int x) { return x * x; }
int dist(int first, int second) {
  return sqr(a[first].x - a[second].x) + sqr(a[first].y - a[second].y);
}
int main() {
  for (int i = 0; i < 8; ++i) {
    cin >> p.x >> p.y;
    a.push_back(p);
    indeces.push_back(i);
  }
  while (next_permutation(indeces.begin(), indeces.end())) {
    if ((normalize(indeces[0], indeces[1], indeces[2])) &&
        (normalize(indeces[1], indeces[2], indeces[3])) &&
        (normalize(indeces[2], indeces[3], indeces[0])) &&
        (normalize(indeces[3], indeces[0], indeces[1])) &&
        (normalize(indeces[4], indeces[5], indeces[6])) &&
        (normalize(indeces[5], indeces[6], indeces[7])) &&
        (normalize(indeces[6], indeces[7], indeces[4])) &&
        (normalize(indeces[7], indeces[4], indeces[5])) &&
        (dist(indeces[0], indeces[1]) == dist(indeces[1], indeces[2]))) {
      cout << "YES" << endl;
      for (int i = 0; i < 4; ++i) {
        if (i > 0) {
          cout << " ";
        }
        cout << indeces[i] + 1;
      }
      cout << endl;
      for (int i = 4; i < 8; ++i) {
        if (i > 4) {
          cout << " ";
        }
        cout << indeces[i] + 1;
      }
      cout << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
