#include <bits/stdc++.h>
using namespace std;
pair<int, int> dat[8];
int main() {
  for (int i = 0; i < 8; i++) {
    scanf("%d%d", &dat[i].first, &dat[i].second);
  }
  int perm[8] = {0, 1, 2, 3, 4, 5, 6, 7};
  do {
    bool ok = false;
    {
      int x1 = dat[perm[0]].first, y1 = dat[perm[0]].second;
      int x2 = dat[perm[1]].first, y2 = dat[perm[1]].second;
      int x3 = dat[perm[2]].first, y3 = dat[perm[2]].second;
      int x4 = dat[perm[3]].first, y4 = dat[perm[3]].second;
      if (x2 - x1 + x3 - x1 == x4 - x1 && y2 - y1 + y3 - y1 == y4 - y1) {
        if (abs(x2 - x1) + abs(y2 - y1) > 0) {
          if (x2 - x1 == y3 - y1 && y2 - y1 == x1 - x3) {
            ok = true;
          }
        }
      }
    }
    if (!ok) continue;
    ok = false;
    {
      int x1 = dat[perm[4]].first, y1 = dat[perm[4]].second;
      int x2 = dat[perm[5]].first, y2 = dat[perm[5]].second;
      int x3 = dat[perm[6]].first, y3 = dat[perm[6]].second;
      int x4 = dat[perm[7]].first, y4 = dat[perm[7]].second;
      if (x2 - x1 + x3 - x1 == x4 - x1 && y2 - y1 + y3 - y1 == y4 - y1) {
        if (abs(x2 - x1) + abs(y2 - y1) > 0) {
          if (abs(x3 - x1) + abs(y3 - y1) > 0) {
            if ((x2 - x1) * (x3 - x1) + (y2 - y1) * (y3 - y1) == 0) {
              ok = true;
            }
          }
        }
      }
    }
    if (ok) {
      printf("YES\n");
      for (int i = 0; i < 8; i++) {
        printf("%d", perm[i] + 1);
        if (i % 4 == 3) {
          printf("\n");
        } else {
          printf(" ");
        }
      }
      return 0;
    }
  } while (next_permutation(perm, perm + 8));
  printf("NO\n");
  return 0;
}
