#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, -1, 1};
const double EPS = 1e-8;
inline int cmp(double x, double y = 0, double tol = EPS) {
  return (x <= y + tol) ? (x + tol < y) ? -1 : 0 : 1;
}
struct point {
  double x, y;
  point(double x = 0, double y = 0) : x(x), y(y) {}
  point operator+(point q) { return point(x + q.x, y + q.y); }
  point operator-(point q) { return point(x - q.x, y - q.y); }
  point operator*(double t) { return point(x * t, y * t); }
  point operator/(double t) { return point(x / t, y / t); }
  double operator*(point q) { return x * q.x + y * q.y; }
  double operator%(point q) { return x * q.y - y * q.x; }
  int cmp(point q) const {
    if (int t = ::cmp(x, q.x)) return t;
    return ::cmp(y, q.y);
  }
  bool operator==(point q) const { return cmp(q) == 0; }
  bool operator!=(point q) const { return cmp(q) != 0; }
  bool operator<(point q) const { return cmp(q) < 0; }
  bool operator<=(point q) const { return cmp(q) <= 0; }
  friend ostream& operator<<(ostream& o, point p) {
    return o << "(" << p.x << ", " << p.y << ")";
  }
  static point pivot;
};
point point::pivot;
double abs(point p) { return hypot(p.x, p.y); }
double arg(point p) { return atan2(p.y, p.x); }
int ccw(point p, point q, point r) { return cmp((p - r) % (q - r)); }
double distancia(point a, point b) {
  return sqrt(pow(a.x - b.x, 2.0) + pow(a.y - b.y, 2.0));
}
struct pnt {
  int x, y, id;
  pnt(){};
  pnt(int a, int b, int c) {
    x = a;
    y = b;
    id = c;
  }
  bool operator<(pnt p) const {
    if (x != p.x)
      return (x < p.x);
    else
      return (y < p.y);
  }
};
double angle(point p, point q, point r) {
  point u = p - q, v = r - q;
  return atan2(u % v, u * v);
}
pnt v[8];
const int n = 8;
double dist(pnt a, pnt b) {
  return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
}
bool test() {
  set<double> s1, s2;
  s1.insert(dist(v[0], v[3]));
  for (int i = 1; i < 4; ++i) {
    point p1, p2, p3;
    if (i == 1) {
      p1.x = v[3].x;
      p1.y = v[3].y;
    } else {
      p1.x = v[i - 2].x;
      p1.y = v[i - 2].y;
    }
    p2.x = v[i - 1].x;
    p2.y = v[i - 1].y;
    p3.x = v[i].x;
    p3.y = v[i].y;
    if (fabs(angle(p1, p2, p3) - (90 * M_PI / 180)) > EPS) return false;
    s1.insert(dist(v[i], v[i - 1]));
  }
  s2.insert(dist(v[4], v[7]));
  for (int i = 5; i < 8; ++i) {
    point p1, p2, p3;
    if (i == 5) {
      p1.x = v[7].x;
      p1.y = v[7].y;
    } else {
      p1.x = v[i - 2].x;
      p1.y = v[i - 2].y;
    }
    p2.x = v[i - 1].x;
    p2.y = v[i - 1].y;
    p3.x = v[i].x;
    p3.y = v[i].y;
    if (fabs(angle(p1, p2, p3) - (90 * M_PI / 180)) > EPS) return false;
    s2.insert(dist(v[i], v[i - 1]));
  }
  return (s1.size() == 1 && s2.size() <= 2);
}
int main() {
  for (int i = 0; i < n; ++i) {
    int x, y;
    scanf("%d %d", &x, &y);
    v[i] = pnt(x, y, i);
  }
  sort(v, v + n);
  do {
    if (test()) {
      printf("YES\n");
      for (int i = 0; i < 4; ++i) printf("%d ", v[i].id + 1);
      printf("\n");
      for (int i = 4; i < 8; ++i) printf("%d ", v[i].id + 1);
      printf("\n");
      return 0;
    }
  } while (next_permutation(v, v + n));
  printf("NO\n");
  return 0;
}
