#include <bits/stdc++.h>
using namespace std;
int x[10], y[10], n = 8;
inline int sq(int x) { return x * x; }
bool equal(double x, double y) { return fabs(x - y) < 1e-11; }
int triangle_area(int i, int j, int k) {
  int value =
      x[i] * (y[j] - y[k]) - x[j] * (y[i] - y[k]) + x[k] * (y[i] - y[j]);
  return abs(value);
}
bool square(int mask) {
  vector<int> v;
  for (int i = 0, _e(8); i < _e; i++)
    if (mask & (1 << i)) v.push_back(i);
  vector<double> dist;
  for (int i = 0, _e(4); i < _e; i++)
    for (int j = 0, _e(i); j < _e; j++)
      dist.push_back(sq(x[v[i]] - x[v[j]]) + sq(y[v[i]] - y[v[j]]));
  sort(dist.begin(), dist.end());
  for (int i(1), _e(3); i <= _e; i++)
    if (dist[i] != dist[i - 1]) return 0;
  if (equal(dist[5], dist[3])) return 0;
  if (dist[4] != dist[5]) return 0;
  if (dist[0] + dist[0] != dist[5]) return 0;
  for (int i = 0, _e(4); i < _e; i++)
    for (int j = 0, _e(i); j < _e; j++)
      for (int k = 0, _e(j); k < _e; k++)
        if (!triangle_area(v[i], v[j], v[k])) return 0;
  return 1;
}
bool rectangle(int mask) {
  vector<int> v;
  for (int i = 0, _e(8); i < _e; i++)
    if (mask & (1 << i)) v.push_back(i);
  vector<double> dist;
  for (int i = 0, _e(4); i < _e; i++)
    for (int j = 0, _e(i); j < _e; j++)
      dist.push_back(sq(x[v[i]] - x[v[j]]) + sq(y[v[i]] - y[v[j]]));
  sort(dist.begin(), dist.end());
  if (dist[0] != dist[1]) return 0;
  if (dist[2] != dist[3]) return 0;
  if (dist[4] != dist[5]) return 0;
  if (dist[0] + dist[3] != dist[5]) return 0;
  for (int i = 0, _e(4); i < _e; i++)
    for (int j = 0, _e(i); j < _e; j++)
      for (int k = 0, _e(j); k < _e; k++)
        if (!triangle_area(v[i], v[j], v[k])) return 0;
  return 1;
}
int main() {
  for (int i = 0, _e(n); i < _e; i++) cin >> x[i] >> y[i];
  for (int i = 0, _e(n); i < _e; i++)
    for (int j = 0, _e(i); j < _e; j++)
      for (int k = 0, _e(j); k < _e; k++)
        for (int l = 0, _e(k); l < _e; l++) {
          int mask1 = (1 << i) | (1 << j) | (1 << k) | (1 << l);
          int mask2 = ((1 << 8) - 1) & ~(mask1);
          if (square(mask1) && rectangle(mask2)) {
            cout << "YES" << endl;
            cout << l + 1 << " " << k + 1 << " " << j + 1 << " " << i + 1
                 << endl;
            for (int b = 0, _e(8); b < _e; b++)
              if (mask2 & (1 << b)) cout << " " << b + 1;
            cout << endl;
            return 0;
          }
        }
  cout << "NO" << endl;
  return 0;
}
