#include <bits/stdc++.h>
const double pi = 3.1415926535897932384626433832795;
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
using namespace std;
void ifd() {}
void tme() {}
pair<int, int> d[10];
bool check(int mask) {
  vector<pair<int, int> > a, b;
  vector<vector<long long> > a1, b1;
  a.clear();
  b.clear();
  a1.resize(4);
  b1.resize(4);
  for (int i = (0); i < (8); ++i)
    if ((mask >> i) & 1)
      a.push_back(d[i]);
    else
      b.push_back(d[i]);
  if (a.size() != 4) return false;
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  for (int i = (0); i < (4); ++i) {
    for (int j = (0); j < (4); ++j)
      if (i != j)
        a1[i].push_back(
            (a[i].first - a[j].first) * (a[i].first - a[j].first) * 1ll +
            (a[i].second - a[j].second) * (a[i].second - a[j].second) * 1ll);
    sort(a1[i].begin(), a1[i].end());
  }
  for (int i = (0); i < (4); ++i) {
    if (a1[i][0] != a1[i][1]) return false;
    for (int j = (0); j < (4); ++j)
      if (a1[i] != a1[j]) return false;
  }
  for (int i = (0); i < (4); ++i) {
    for (int j = (0); j < (4); ++j)
      if (i != j)
        b1[i].push_back(
            (b[i].first - b[j].first) * (b[i].first - b[j].first) * 1ll +
            (b[i].second - b[j].second) * (b[i].second - b[j].second) * 1ll);
    sort(b1[i].begin(), b1[i].end());
  }
  for (int i = (0); i < (4); ++i) {
    for (int j = (0); j < (4); ++j)
      if (b1[i] != b1[j]) return false;
  }
  return true;
}
int main() {
  ifd();
  bool ans = false;
  int res;
  for (int i = (0); i < (8); ++i) cin >> d[i].first >> d[i].second;
  for (int i = (0); i < (1 << 8); ++i) {
    if (check(i)) {
      ans = true;
      res = i;
      break;
    }
  }
  if (ans) {
    cout << "YES" << endl;
    vector<int> a, b;
    for (int i = (0); i < (8); ++i)
      if ((res >> i) & 1)
        a.push_back(i + 1);
      else
        b.push_back(i + 1);
    for (int i = (0); i < (3); ++i) cout << a[i] << " ";
    cout << a[3] << endl;
    for (int i = (0); i < (3); ++i) cout << b[i] << " ";
    cout << b[3] << endl;
  } else
    cout << "NO" << endl;
  tme();
  return 0;
}
