#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5, inf = 2e9, mod = 1e9 + 7;
vector<int> prime_Numbers;
bool primes[1000005];
double dot(complex<double> a, complex<double> b) {
  return (conj(a) * b).real();
}
double cross(complex<double> a, complex<double> b) {
  return (conj(a) * b).imag();
}
int a[8] = {0, 1, 2, 3, 4, 5, 6, 7};
pair<int, int> p[8];
long long getdistance(int x, int y) {
  return ((p[a[x]].first - p[a[y]].first) * (p[a[x]].first - p[a[y]].first)) +
         ((p[a[x]].second - p[a[y]].second) *
          (p[a[x]].second - p[a[y]].second));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  for (int i = 0; i < 8; i++) cin >> p[i].first >> p[i].second;
  do {
    if (getdistance(0, 1) == getdistance(1, 2) &&
        getdistance(1, 2) == getdistance(2, 3) &&
        getdistance(2, 3) == getdistance(3, 0) &&
        getdistance(3, 0) == getdistance(0, 1) &&
        getdistance(0, 2) == getdistance(1, 3) &&
        getdistance(4, 5) == getdistance(6, 7) &&
        getdistance(5, 6) == getdistance(7, 4) &&
        getdistance(4, 6) == getdistance(5, 7)) {
      cout << "YES" << endl;
      for (int i = 0; i < 4; i++) {
        cout << a[i] + 1 << " ";
      }
      cout << endl;
      for (int i = 4; i < 8; i++) {
        cout << a[i] + 1 << " ";
      }
      return 0;
    }
  } while (next_permutation(a, a + 8));
  cout << "NO";
  return 0;
}
