#include <bits/stdc++.h>
using namespace std;
const int INF = 2000000000;
const double EPS = 1e-9;
const double PI = 3.1415926535897932384626433832795;
template <typename T>
T sqr(const T &x) {
  return x * x;
}
template <typename T>
string GetString(const T &val) {
  ostringstream sout;
  sout << val;
  return sout.str();
}
struct Point {
  int x, y, id;
  Point(int _x = 0, int _y = 0, int _id = 0) : x(_x), y(_y), id(_id) {}
  void Read(int _id) {
    cin >> x >> y;
    id = _id;
  }
  friend bool operator<(const Point &p, const Point &q) { return p.id < q.id; }
  Point operator-(const Point &p) const { return Point(x - p.x, y - p.y); }
  int Dot(const Point &p) const { return x * p.x + y * p.y; }
  int SqrAbs() const { return this->Dot(*this); }
};
const int SZ = 8;
Point p[SZ];
void Init() {
  for (int i = 0; i < (SZ); ++i) {
    p[i].Read(i + 1);
  }
}
bool IsSquare() {
  Point a = p[1] - p[0];
  Point b = p[2] - p[1];
  Point c = p[3] - p[2];
  Point d = p[0] - p[3];
  return (b.Dot(a) == 0 && c.Dot(b) == 0 && d.Dot(c) == 0 && a.Dot(d) == 0) &&
         (a.SqrAbs() == c.SqrAbs() && b.SqrAbs() == d.SqrAbs() &&
          a.SqrAbs() == b.SqrAbs());
}
bool IsRect() {
  Point a = p[5] - p[4];
  Point b = p[6] - p[5];
  Point c = p[7] - p[6];
  Point d = p[4] - p[7];
  return (b.Dot(a) == 0 && c.Dot(b) == 0 && d.Dot(c) == 0 && a.Dot(d) == 0) &&
         (a.SqrAbs() == c.SqrAbs() && b.SqrAbs() == d.SqrAbs());
}
bool IsGood() { return IsSquare() && IsRect(); }
void YES() {
  cout << "YES" << endl;
  for (int i = 0; i < (4); ++i) {
    cout << p[i].id << ' ';
  }
  cout << endl;
  for (int i = 0; i < (4); ++i) {
    cout << p[i + 4].id << ' ';
  }
  cout << endl;
  exit(0);
}
void NO() {
  cout << "NO" << endl;
  exit(0);
}
int main() {
  Init();
  do {
    if (IsGood()) YES();
  } while (next_permutation(p, p + SZ));
  NO();
  return 0;
}
