#include <bits/stdc++.h>
using namespace std;
const int MAXN = 10;
int p[MAXN][2];
int vis[MAXN];
int checkMid(int idx[]) {
  int mx1, mx2, my1, my2;
  mx1 = p[idx[0]][0] + p[idx[2]][0];
  my1 = p[idx[0]][1] + p[idx[2]][1];
  mx2 = p[idx[1]][0] + p[idx[3]][0];
  my2 = p[idx[1]][1] + p[idx[3]][1];
  return mx1 == mx2 && my1 == my2;
}
int checkDot(int idx[]) {
  int px1, px2, py1, py2;
  px1 = p[idx[0]][0] - p[idx[2]][0];
  py1 = p[idx[0]][1] - p[idx[2]][1];
  px2 = p[idx[1]][0] - p[idx[3]][0];
  py2 = p[idx[1]][1] - p[idx[3]][1];
  return px1 * px2 + py1 * py2 == 0;
}
int checkLen(int idx[]) {
  int px1, px2, py1, py2;
  px1 = p[idx[0]][0] - p[idx[2]][0];
  py1 = p[idx[0]][1] - p[idx[2]][1];
  px2 = p[idx[1]][0] - p[idx[3]][0];
  py2 = p[idx[1]][1] - p[idx[3]][1];
  return px1 * px1 + py1 * py1 == px2 * px2 + py2 * py2;
}
int checkCross(int idx[]) {
  int px1, px2, py1, py2;
  px1 = p[idx[0]][0] - p[idx[2]][0];
  py1 = p[idx[0]][1] - p[idx[2]][1];
  px2 = p[idx[1]][0] - p[idx[3]][0];
  py2 = p[idx[1]][1] - p[idx[3]][1];
  return px1 * py2 - px2 * py1 != 0;
}
int cal() {
  int p1[4], p2[4];
  for (int i = 0; i < 8; ++i)
    if (vis[i] < 4)
      p1[vis[i] % 4] = i;
    else
      p2[vis[i] % 4] = i;
  if (checkMid(p1) && checkLen(p1) && checkCross(p1) && checkMid(p2) &&
      checkLen(p2) && checkCross(p2) && checkDot(p1)) {
    puts("YES");
    for (int i = 0; i < 4; ++i) printf("%d%c", p1[i] + 1, i < 3 ? ' ' : '\n');
    for (int i = 0; i < 4; ++i) printf("%d%c", p2[i] + 1, i < 3 ? ' ' : '\n');
    return 1;
  }
  return 0;
}
int search(int step) {
  if (step == 8) {
    if (cal()) return 1;
    return 0;
  }
  for (int i = 0; i < 8; ++i)
    if (vis[i] == -1) {
      vis[i] = step;
      if (search(step + 1)) return 1;
      vis[i] = -1;
    }
  return 0;
}
void solve() {
  memset(vis, 255, sizeof(vis));
  if (!search(0)) puts("NO");
}
int main() {
  for (int i = 0; i < 8; ++i) scanf("%d%d", p[i], p[i] + 1);
  solve();
  return 0;
}
