#include <bits/stdc++.h>
using std::abs;
using std::sort;
using std::vector;
const double e = 0.0000001;
struct point {
  int x, y, i;
  void read() { scanf("%d %d", &x, &y); }
  point() {}
  void print() { printf("%d %d\n", x, y); }
  bool operator<(const point &b) const {
    if (x == b.x) return y < b.y;
    return x < b.x;
  }
} p[8], t[4];
double getdis(point a, point b) {
  return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
bool same(double a, double b) { return abs(a - b) < e; }
bool dif(double a, double b) { return abs(a - b) > e; }
struct Vector {
  int x, y;
  double len;
  Vector(point a, point b) {
    x = a.x - b.x;
    y = a.y - b.y;
    length();
  }
  void length() { len = sqrt(x * x + y * y); }
  int operator*(const Vector &b) { return x * b.x + y * b.y; }
  bool operator<(const Vector &b) const { return len < b.len; }
  Vector() {}
} v[6];
bool sqe(vector<int> in) {
  for (int i = 0; i < 4; i++) t[i] = p[in[i]];
  int p = 0;
  bool f[4][4];
  memset(f, 0, sizeof(f));
  for (int i = 0; i < 3; i++)
    for (int j = i + 1; j < 4; j++)
      if (!f[i][j]) {
        v[p++] = Vector(t[i], t[j]);
        f[i][j] = f[j][i] = true;
      }
  sort(v, v + 6);
  int cnt = 0;
  for (int i = 0; i < 3; i++)
    for (int j = i + 1; j < 4; j++)
      if (v[i] * v[j] == 0) cnt++;
  if (same(v[0].len, v[1].len) && same(v[1].len, v[2].len) &&
      same(v[2].len, v[3].len) && same(v[4].len, v[5].len) && (cnt == 4))
    return 1;
  return 0;
}
bool rec(vector<int> in) {
  for (int i = 0; i < 4; i++) t[i] = p[in[i]];
  int p = 0;
  bool f[4][4];
  memset(f, 0, sizeof(f));
  for (int i = 0; i < 3; i++)
    for (int j = i + 1; j < 4; j++)
      if (!f[i][j]) {
        v[p++] = Vector(t[i], t[j]);
        f[i][j] = f[j][i] = true;
      }
  sort(v, v + 6);
  int cnt = 0;
  for (int i = 0; i < 3; i++)
    for (int j = i + 1; j < 4; j++)
      if (v[i] * v[j] == 0) cnt++;
  if (same(v[0].len, v[1].len) && same(v[2].len, v[3].len) &&
      same(v[4].len, v[5].len) && (cnt == 4))
    return 1;
  return 0;
}
bool in[8], finish = false;
int list[4];
void dfs(int now) {
  if (finish) return;
  if (now < 4) {
    for (int i = 0; i < 8; i++)
      if (!in[i]) {
        list[now] = i;
        in[i] = true;
        dfs(now + 1);
        in[i] = false;
      }
  } else {
    vector<int> i2, i1;
    for (int i = 0; i < 4; i++) i1.push_back(list[i]);
    for (int i = 0; i < 8; i++)
      if (!in[i]) i2.push_back(i);
    if (sqe(i1) && rec(i2)) {
      printf("YES\n");
      for (int i = 0; i < 4; i++) printf("%d ", i1[i] + 1);
      printf("\n");
      for (int i = 0; i < 4; i++) printf("%d ", i2[i] + 1);
      printf("\n");
      finish = true;
    }
  }
}
int main() {
  for (int i = 0; i < 8; i++) p[i].read(), p[i].i = i;
  dfs(0);
  if (!finish) printf("NO\n");
  return 0;
}
