#include <bits/stdc++.h>
using namespace std;
int getDistSquared(pair<int, int> a, pair<int, int> b) {
  return (a.first - b.first) * (a.first - b.first) +
         (a.second - b.second) * (a.second - b.second);
}
bool checkAngles(vector<pair<int, int>> vec) {
  return getDistSquared(vec[0], vec[1]) + getDistSquared(vec[1], vec[2]) ==
             getDistSquared(vec[2], vec[0]) &&
         getDistSquared(vec[1], vec[2]) + getDistSquared(vec[2], vec[3]) ==
             getDistSquared(vec[3], vec[1]) &&
         getDistSquared(vec[2], vec[3]) + getDistSquared(vec[3], vec[0]) ==
             getDistSquared(vec[0], vec[2]);
}
int getShape(vector<pair<int, int>> vec) {
  set<int> width, height;
  for (int i = 1; i < 4; ++i) {
    if (i & 1) {
      width.insert(getDistSquared(vec[i], vec[i - 1]));
    } else {
      height.insert(getDistSquared(vec[i], vec[i - 1]));
    }
    if (width.size() > 1 || height.size() > 1) {
      return 3;
    }
  }
  if (width.count(0) || height.count(0) || !checkAngles(vec)) {
    return 3;
  }
  return 1 + (*width.begin() != *height.begin());
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  vector<pair<int, int>> points(8);
  for (auto &p : points) {
    cin >> p.first >> p.second;
  }
  vector<int> perm = {0, 1, 2, 3, 4, 5, 6, 7};
  do {
    if (getShape({points[perm[0]], points[perm[1]], points[perm[2]],
                  points[perm[3]]}) == 1 &&
        getShape({points[perm[4]], points[perm[5]], points[perm[6]],
                  points[perm[7]]}) <= 2) {
      cout << "YES\n";
      for (int i = 0; i < 4; ++i) {
        cout << perm[i] + 1 << " \n"[i == 3];
      }
      for (int i = 4; i < 8; ++i) {
        cout << perm[i] + 1 << " \n"[i == 7];
      }
      return 0;
    }
  } while (next_permutation(perm.begin(), perm.end()));
  cout << "NO\n";
  return 0;
}
