#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> sub(pair<long long, long long> a,
                               pair<long long, long long> b) {
  return pair<long long, long long>(a.first - b.first, a.second - b.second);
}
long long sq(long long x) { return x * x; }
bool isOrthogonal(pair<long long, long long> a1, pair<long long, long long> a2,
                  pair<long long, long long> b1,
                  pair<long long, long long> b2) {
  pair<long long, long long> c(sub(a1, a2)), d(sub(b1, b2));
  return c.first * d.first + c.second * d.second == 0;
}
long long dist(pair<long long, long long> a, pair<long long, long long> b) {
  return sq(a.first - b.first) + sq(a.second - b.second);
}
bool isRectangle(pair<long long, long long> a, pair<long long, long long> b,
                 pair<long long, long long> c, pair<long long, long long> d) {
  if (!isOrthogonal(a, b, a, d)) return false;
  if (!isOrthogonal(a, b, b, c)) return false;
  if (dist(a, b) != dist(c, d)) return false;
  if (dist(a, d) != dist(b, c)) return false;
  return true;
}
bool isSquare(pair<long long, long long> a, pair<long long, long long> b,
              pair<long long, long long> c, pair<long long, long long> d) {
  if (!isRectangle(a, b, c, d)) return false;
  return dist(a, b) == dist(b, c);
}
int main() {
  ios_base::sync_with_stdio(0);
  vector<pair<pair<long long, long long>, int> > v(8);
  for (int i = (0); i < ((8)); ++i) {
    long long x, y;
    cin >> x >> y;
    v[i].first = make_pair(x, y);
    v[i].second = i + 1;
  }
  vector<int> a(8);
  for (int i = (0); i < ((8)); ++i) a[i] = i;
  do {
    if (isSquare(v[a[0]].first, v[a[1]].first, v[a[2]].first, v[a[3]].first) &&
        isRectangle(v[a[4]].first, v[a[5]].first, v[a[6]].first,
                    v[a[7]].first)) {
      cout << "YES" << endl;
      for (int i = (0); i < ((4)); ++i) cout << v[a[i]].second << " ";
      cout << endl;
      for (int i = (0); i < ((4)); ++i) cout << v[a[i + 4]].second << " ";
      cout << endl;
      return 0;
    }
  } while (next_permutation((a).begin(), (a).end()));
  cout << "NO" << endl;
  return 0;
}
