#include <bits/stdc++.h>
using namespace std;
bool eq(double a, double b) { return abs(a - b) < 0.000001; }
int main() {
  while (1) {
    vector<pair<int, int> > V(8);
    vector<int> id(8);
    bool found = false;
    for (int i = 0; i < (int)8; i++) {
      if (cin >> V[i].first >> V[i].second)
        ;
      else
        return 0;
      id[i] = i + 1;
    }
    do {
      vector<pair<int, int> > v(8);
      for (int i = 0; i < (int)8; i++) {
        v[i] = V[id[i] - 1];
      }
      bool ok = true;
      for (int i = 0; i < (int)4; i++) {
        int i1 = i % 4, i2 = (i + 1) % 4, i3 = (i + 2) % 4;
        pair<int, int> s1(v[i2].first - v[i1].first,
                          v[i2].second - v[i1].second),
            s2(v[i3].first - v[i2].first, v[i3].second - v[i2].second);
        if (s1.first * s2.first + s1.second * s2.second != 0) {
          ok = false;
        }
        if (s1.first * s1.first + s1.second * s1.second !=
            s2.first * s2.first + s2.second * s2.second) {
          ok = false;
        }
      }
      for (int i = 0; i < (int)4; i++) {
        int i1 = i % 4 + 4, i2 = (i + 1) % 4 + 4, i3 = (i + 2) % 4 + 4;
        pair<int, int> s1(v[i2].first - v[i1].first,
                          v[i2].second - v[i1].second),
            s2(v[i3].first - v[i2].first, v[i3].second - v[i2].second);
        if (s1.first * s2.first + s1.second * s2.second != 0) {
          ok = false;
        }
      }
      if (ok) {
        cout << "YES";
        for (int i = 0; i < (int)8; i++) {
          if (i % 4 != 0)
            cout << ' ';
          else
            cout << endl;
          cout << id[i];
        }
        cout << endl;
        found = true;
        break;
      }
    } while (next_permutation((id).begin(), (id).end()));
    if (!found) cout << "NO" << endl;
  }
  return 0;
}
