#include <bits/stdc++.h>
using namespace std;
class point {
 public:
  int x, y;
  point(int X = 0, int Y = 0) : x(X), y(Y) {}
  friend istream& operator>>(istream& str, point& a) {
    str >> a.x >> a.y;
    return str;
  }
  point operator+(point a) { return point(a.x + x, a.y + y); }
  point operator-(point a) { return point(x - a.x, y - a.y); }
  bool operator==(point a) { return (a.x == x && a.y == y); }
  int operator&(point a) { return (x * a.x + y * a.y); }
  int operator^(point a) { return (x * a.y - y * a.x); }
};
int main() {
  int a[10], n = 8;
  point w[10], a1, a2, a3, a4;
  for (int i = 0; i < n; ++i) {
    cin >> w[i];
    a[i] = i;
  }
  do {
    a1 = w[a[1]] - w[a[0]];
    a2 = w[a[2]] - w[a[0]];
    a3 = a1 + a2;
    if ((w[a[3]] == w[a[0]] + a3) && (a1 & a2) == 0 && (a1 ^ a2) != 0 &&
        (a1.x * a1.x + a1.y * a1.y == a2.x * a2.x + a2.y * a2.y)) {
    } else {
      continue;
    }
    a1 = w[a[1 + 4]] - w[a[0 + 4]];
    a2 = w[a[2 + 4]] - w[a[0 + 4]];
    a3 = a1 + a2;
    if ((w[a[3 + 4]] == w[a[0 + 4]] + a3) && (a1 & a2) == 0 && (a1 ^ a2) != 0) {
      cout << "YES\n";
      for (int i = 0; i < 4; ++i) cout << a[i] + 1 << ' ';
      cout << endl;
      for (int j = 4; j < 8; ++j) cout << a[j] + 1 << ' ';
      return 0;
    } else {
      continue;
    }
  } while (next_permutation(a, a + n));
  cout << "NO";
  return 0;
}
