#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 1, INF = 1e18 + 1, mod = 1e6 + 3;
long long i, j, k, n, m, answer;
pair<long long, long long> t[8];
long long dist(pair<long long, long long> x0, pair<long long, long long> y0) {
  long long ans = (x0.first - y0.first) * (x0.first - y0.first) +
                  (x0.second - y0.second) * (x0.second - y0.second);
  return ans;
}
bool qv(pair<long long, long long> x0, pair<long long, long long> y0,
        pair<long long, long long> z0, pair<long long, long long> u0) {
  bool ans = 0;
  long long s[6];
  s[0] = dist(x0, y0);
  s[1] = dist(x0, z0);
  s[2] = dist(x0, u0);
  s[3] = dist(y0, z0);
  s[4] = dist(y0, u0);
  s[5] = dist(z0, u0);
  sort(s, s + 6);
  if (s[1] == s[0] && s[0] == s[2] && s[0] == s[3] && s[4] == s[5] &&
      s[4] == s[0] * 2) {
    ans = 1;
  }
  return ans;
}
bool pr(pair<long long, long long> x0, pair<long long, long long> y0,
        pair<long long, long long> z0, pair<long long, long long> u0) {
  bool ans = 0;
  long long s[6], a, b, c, pr1, pr2;
  a = (x0.second - y0.second);
  b = (y0.first - x0.first);
  c = (x0.first * y0.second - y0.first * x0.second);
  pr1 = z0.first * a + z0.second * b + c;
  pr2 = u0.first * a + u0.second * b + c;
  if (pr1 == 0 || pr2 == 0) {
    return 0;
  }
  a = (x0.second - z0.second);
  b = (z0.first - x0.first);
  c = (x0.first * z0.second - z0.first * x0.second);
  pr1 = y0.first * a + y0.second * b + c;
  pr2 = u0.first * a + u0.second * b + c;
  if (pr1 == 0 || pr2 == 0) {
    return 0;
  }
  a = (x0.second - u0.second);
  b = (u0.first - x0.first);
  c = (x0.first * u0.second - u0.first * x0.second);
  pr1 = y0.first * a + y0.second * b + c;
  pr2 = z0.first * a + z0.second * b + c;
  if (pr1 == 0 || pr2 == 0) {
    return 0;
  }
  s[0] = dist(x0, y0);
  s[1] = dist(x0, z0);
  s[2] = dist(x0, u0);
  s[3] = dist(y0, z0);
  s[4] = dist(y0, u0);
  s[5] = dist(z0, u0);
  sort(s, s + 6);
  if (s[0] == s[1] && s[2] == s[3] && s[4] == s[5] && s[0] + s[2] == s[4]) {
    ans = 1;
  }
  return ans;
}
pair<pair<long long, long long>, pair<long long, long long> > f(long long x0,
                                                                long long y0,
                                                                long long z0,
                                                                long long u0) {
  pair<pair<long long, long long>, pair<long long, long long> > ans;
  long long jd = 0;
  for (long long i1 = 0; i1 < 8; ++i1) {
    if (i1 != x0 && i1 != y0 && i1 != z0 && i1 != u0) {
      if (jd == 0) {
        ans.first.first = i1;
      }
      if (jd == 1) {
        ans.first.second = i1;
      }
      if (jd == 2) {
        ans.second.first = i1;
      }
      if (jd == 3) {
        ans.second.second = i1;
      }
      jd++;
    }
  }
  return ans;
}
int main() {
  for (i = 0; i < 8; ++i) {
    cin >> t[i].first >> t[i].second;
  }
  n = 8;
  for (i = 0; i < n; ++i) {
    for (j = 0; j < n; ++j) {
      for (long long i1 = 0; i1 < n; ++i1) {
        for (long long id = 0; id < n; ++id) {
          if (id == i1 || id == i || id == j || i1 == i || i1 == j || i == j) {
            continue;
          }
          pair<pair<long long, long long>, pair<long long, long long> > s0 =
              f(i, j, i1, id);
          if (qv(t[i], t[j], t[i1], t[id]) &&
              pr(t[s0.first.first], t[s0.first.second], t[s0.second.first],
                 t[s0.second.second])) {
            cout << "YES" << endl;
            cout << i + 1 << " " << j + 1 << " " << i1 + 1 << " " << id + 1
                 << endl;
            cout << s0.first.first + 1 << " " << s0.first.second + 1 << " "
                 << s0.second.first + 1 << " " << s0.second.second + 1;
            return 0;
          }
        }
      }
    }
  }
  cout << "NO";
}
