#include <bits/stdc++.h>
using namespace std;
const int n = 8;
pair<long long, long long> pts[n];
long long dist2(int i, int j) {
  return (pts[i].first - pts[j].first) * (pts[i].first - pts[j].first) +
         (pts[i].second - pts[j].second) * (pts[i].second - pts[j].second);
}
bool pram(int i, int j, int k, int t) {
  if (pts[i].first + pts[k].first == pts[j].first + pts[t].first &&
      pts[i].second + pts[k].second == pts[j].second + pts[t].second &&
      dist2(i, k) == dist2(j, t))
    return true;
  return false;
}
bool square(int i, int j, int k, int t) {
  if (pram(i, j, k, t) && dist2(i, j) == dist2(j, k)) return true;
  return false;
}
int main() {
  int i;
  for (i = 0; i < n; ++i) {
    cin >> pts[i].first >> pts[i].second;
    pts[i].first <<= 1;
    pts[i].second <<= 1;
  }
  vector<int> v(n);
  for (i = 0; i < n; ++i) v[i] = i;
  do {
    if (square(v[0], v[1], v[2], v[3]) && pram(v[4], v[5], v[6], v[7])) {
      cout << "YES\n";
      for (i = 0; i < 4; ++i) cout << v[i] + 1 << ' ';
      cout << endl;
      for (i = 4; i < n; ++i) cout << v[i] + 1 << ' ';
      cout << endl;
      return 0;
    }
  } while (next_permutation(v.begin(), v.end()));
  cout << "NO\n";
  return 0;
}
