#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.1415926535897;
long long exp(long long base, long long power, int p) {
  if (!base) return 0;
  long long t = exp(base, power / 2, p);
  if (power & 1)
    return t * t * base % p;
  else
    return t * t % p;
}
int dist(pair<int, int> a, pair<int, int> b) {
  return abs(pow(abs(a.first - b.first), 2) + pow(abs(a.second - b.second), 2));
}
bool check_sq(vector<pair<int, int> > v) {
  pair<int, int> a, b, c, d;
  a = v[0], b = v[1], c = v[2], d = v[3];
  if (dist(a, b) == dist(a, c) && dist(a, b) == dist(c, d) &&
      dist(a, c) == dist(b, d) && dist(a, d) == dist(b, c))
    return true;
  return false;
}
bool is_sq(vector<pair<int, int> > v) {
  do {
    if (check_sq(v)) return true;
  } while (next_permutation(v.begin(), v.end()));
  return false;
}
bool check_rect(vector<pair<int, int> > v) {
  pair<int, int> a, b, c, d;
  a = v[0], b = v[1], c = v[2], d = v[3];
  if (dist(a, b) == dist(c, d) && dist(a, c) == dist(b, d) &&
      dist(a, d) == dist(b, c))
    return true;
  return false;
}
bool is_rect(vector<pair<int, int> > v) {
  do {
    if (check_rect(v)) return true;
  } while (next_permutation(v.begin(), v.end()));
  return false;
}
void solve() {
  const int n = 8;
  pair<int, int> p[8];
  map<pair<int, int>, int> m;
  for (int i = 0; i < 8; i++) cin >> p[i].first >> p[i].second, m[p[i]] = i + 1;
  vector<int> v = {0, 0, 0, 0, 1, 1, 1, 1};
  do {
    vector<pair<int, int> > a, b;
    for (int i = 0; i < n; i++)
      if (v[i])
        b.push_back(p[i]);
      else
        a.push_back(p[i]);
    if (is_rect(a) && is_sq(b)) {
      cout << "YES"
           << "\n";
      for (auto x : b) cout << m[x] << " ";
      cout << "\n";
      for (auto x : a) cout << m[x] << " ";
      cout << "\n";
      return;
    }
  } while (next_permutation(v.begin(), v.end()));
  cout << "NO";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
