#include <bits/stdc++.h>
using namespace std;
int n;
int x[10], y[10], vis[10];
bool flag = false;
int dis(int a, int b) {
  return (x[a] - x[b]) * (x[a] - x[b]) + (y[a] - y[b]) * (y[a] - y[b]);
}
int main() {
  for (int i = 1; i <= 8; i++) {
    scanf("%d %d", &x[i], &y[i]);
  }
  for (int i = 1; i <= 8; i++) {
    vis[i] = 1;
    for (int j = 1; j <= 8; j++) {
      if (vis[j]) continue;
      vis[j] = 1;
      for (int k = 1; k <= 8; k++) {
        if (vis[k]) continue;
        vis[k] = 1;
        for (int l = 1; l <= 8; l++) {
          if (vis[l]) continue;
          vis[l] = 1;
          for (int m = 1; m <= 8; m++) {
            if (vis[m]) continue;
            vis[m] = 1;
            for (int n = 1; n <= 8; n++) {
              if (vis[n]) continue;
              vis[n] = 1;
              for (int o = 1; o <= 8; o++) {
                if (vis[o]) continue;
                vis[o] = 1;
                for (int p = 1; p <= 8; p++) {
                  if (vis[p]) continue;
                  if (dis(i, j) == dis(j, k) && dis(j, k) == dis(k, l) &&
                      dis(k, l) == dis(l, i) && dis(i, k) == dis(j, l) &&
                      dis(m, n) == dis(o, p) && dis(m, p) == dis(n, o) &&
                      dis(m, o) == dis(n, p)) {
                    printf("YES\n%d %d %d %d\n%d %d %d %d\n", i, j, k, l, m, n,
                           o, p);
                    flag = true;
                    break;
                  }
                }
                vis[o] = 0;
                if (flag) break;
              }
              vis[n] = 0;
              if (flag) break;
            }
            vis[m] = 0;
            if (flag) break;
          }
          vis[l] = 0;
          if (flag) break;
        }
        vis[k] = 0;
        if (flag) break;
      }
      vis[j] = 0;
      if (flag) break;
    }
    vis[i] = 0;
    if (flag) break;
  }
  if (!flag) printf("NO\n");
  return 0;
}
