#include <bits/stdc++.h>
using namespace std;
int x[8], y[8];
int main() {
  for (int i = 0; i < 8; i++) cin >> x[i] >> y[i];
  for (int i = 0; i < (1 << 8); i++)
    if (__builtin_popcount(i) == 4) {
      set<int> s;
      s.clear();
      for (int j = 0; j < 8; j++)
        if (i >> j & 1)
          for (int k = j + 1; k < 8; k++)
            if (i >> k & 1)
              s.insert((x[k] - x[j]) * (x[k] - x[j]) +
                       (y[k] - y[j]) * (y[k] - y[j]));
      if (s.size() != 2) continue;
      s.clear();
      int a[4], t = 0;
      for (int j = 0; j < 8; j++)
        if (!(i >> j & 1)) a[t++] = j;
      bool f = false;
      do {
        bool k = true;
        for (int j = 0; j < 4; j++) {
          int p1 = a[(j + 3) % 4], p2 = a[(j + 1) % 4];
          double d =
              abs(atan2(y[p1] - y[a[j]], x[p1] - x[a[j]]) * 180 / 3.14159265 -
                  atan2(y[p2] - y[a[j]], x[p2] - x[a[j]]) * 180 / 3.14159265);
          if (abs(d - 270) > 1e-4 && abs(d - 90) > 1e-4) k = false;
        }
        if (k) {
          f = true;
          break;
        }
      } while (next_permutation(a, a + 4));
      if (!f) continue;
      cout << "YES\n";
      for (int j = 0; j < 8; j++)
        if (i & (1 << j)) cout << j + 1 << ' ';
      cout << '\n';
      for (int j = 0; j < 8; j++)
        if (!(i & (1 << j))) cout << j + 1 << ' ';
      return 0;
    }
  cout << "NO";
}
