#include <bits/stdc++.h>
using namespace std;
const int N = 10;
struct pt {
  int x, y;
  pt(int a = 0, int b = 0) {
    x = a;
    y = b;
  }
  pt operator-(pt p) { return pt(x - p.x, y - p.y); }
  int operator*(pt p) { return x * p.y - y * p.x; }
  int operator/(pt p) { return x * p.x + y * p.y; }
  int dis() { return x * x + y * y; }
  friend bool operator<(pt p1, pt p2) {
    return p1.y < p2.y || p1.y == p2.y && p1.x < p2.x;
  }
} p[N], p1[N], p2[N];
bool lala;
void tubao(pt p[], int &n, pt q[]) {
  int tl = -1, tmp, i;
  sort(p, p + n);
  q[++tl] = p[0];
  q[++tl] = p[1];
  for (i = 2; i < n; i++) {
    while (tl > 0 && (q[tl] - p[i]) * (q[tl - 1] - p[i]) >= 0) tl--;
    q[++tl] = p[i];
  }
  tmp = tl;
  for (i = n - 2; i >= 0; i--) {
    while (tl != tmp && (q[tl] - p[i]) * (q[tl - 1] - p[i]) >= 0) tl--;
    q[++tl] = p[i];
  }
  n = tl--;
}
int get(pt p[]) {
  pt q[N];
  int n = 4;
  tubao(p, n, q);
  bool yes = true;
  for (int i = 0; i < 4; ++i) {
    int j = (i + 1) % 4, k = (i + 2) % 4;
    pt a = q[j] - q[i];
    pt b = q[k] - q[j];
    if (a / b) {
      yes = false;
      break;
    }
  }
  if (yes) {
    int d = (q[1] - q[0]).dis();
    bool ok = true;
    for (int i = 1; i < 4; ++i) {
      int j = (i + 1) % 4;
      if ((q[j] - q[i]).dis() != d) {
        ok = false;
        break;
      }
    }
    if (ok) return 1;
    return 2;
  }
  return 0;
}
int main() {
  for (int i = 1; i <= 8; ++i) scanf("%d%d", &p[i].x, &p[i].y);
  for (int i = 2; i <= 8; ++i)
    for (int j = i + 1; j <= 8; ++j)
      for (int k = j + 1; k <= 8; ++k) {
        p1[0] = p[1];
        p1[1] = p[i];
        p1[2] = p[j];
        p1[3] = p[k];
        int tl = -1;
        int ans[N];
        for (int l = 2; l <= 8; ++l) {
          if (l != i && l != j && l != k) p2[++tl] = p[l], ans[tl] = l;
        }
        int t1 = get(p1);
        int t2 = get(p2);
        if (t1 == 1 && t2 == 2 || t1 == 1 && t2 == 1) {
          puts("YES");
          printf("1 %d %d %d\n", i, j, k);
          for (int l = 0; l < 4; ++l)
            printf("%d%c", ans[l], l == 3 ? '\n' : ' ');
          return 0;
        } else if (t1 == 2 && t2 == 1) {
          puts("YES");
          for (int l = 0; l < 4; ++l)
            printf("%d%c", ans[l], l == 3 ? '\n' : ' ');
          printf("1 %d %d %d\n", i, j, k);
          return 0;
        }
      }
  puts("NO");
  return 0;
}
