#include <bits/stdc++.h>
using namespace std;
pair<int, int> p[8];
map<pair<int, int>, int> mp;
pair<int, int> sub(pair<int, int> p1, pair<int, int> p2) {
  pair<int, int> d;
  d.first = p1.first - p2.first;
  d.second = p1.second - p2.second;
  return d;
}
int mod(int a) {
  if (a < 0) return -a;
  return a;
}
bool check(int a, int b, int c, int d) {
  if (a == 0 && b == 1 && c == 6 && d == 7) return 0;
  return 0;
}
bool checkrec(int i, int j, int k, int l) {
  bool pr = 0;
  if (check(i, j, k, l)) {
    cout << "z";
    pr = 1;
    for (int i2 = 0; i2 < 8; i2++)
      if (i2 == i || i2 == j || i2 == k || i2 == l)
        cout << i2 << " : " << p[i2].first << " " << p[i2].second << "\n";
    cout << mp[p[i]] << " " << mp[p[j]] << " " << mp[p[k]] << " " << mp[p[l]]
         << "\n";
  }
  pair<int, int> d1 = sub(p[l], p[i]);
  pair<int, int> d2 = sub(p[k], p[j]);
  int d11 = d1.first * d1.first + d1.second * d1.second;
  int d22 = d2.first * d2.first + d2.second * d2.second;
  if (d11 != d22) return 0;
  pair<int, int> d3 = sub(p[j], p[i]);
  pair<int, int> d4 = sub(p[l], p[k]);
  if (mod(d3.second * d4.first) != mod(d4.second * d3.first)) return 0;
  if (pr == 1) cout << "x";
  pair<int, int> d5 = d3;
  pair<int, int> d6 = d4;
  d3 = sub(p[l], p[j]);
  d4 = sub(p[k], p[i]);
  if (mod(d3.second * d4.first) != mod(d4.second * d3.first)) return 0;
  if (pr == 1)
    cout << d3.first << " " << d3.second << " " << d5.first << " " << d5.second
         << "\n";
  if (d3.second * d5.second + d3.first * d5.first != 0) return 0;
  if (pr == 1) cout << "zr";
  if (d3.second * d6.second + d3.first * d6.first != 0) return 0;
  if (d4.second * d6.second + d4.first * d6.first != 0) return 0;
  if (d4.second * d5.second + d4.first * d5.first != 0) return 0;
  return 1;
}
bool checksq(int i, int j, int k, int l) {
  if (!checkrec(i, j, k, l)) return 0;
  pair<int, int> d1 = sub(p[l], p[i]);
  pair<int, int> d2 = sub(p[k], p[j]);
  bool pr = 0;
  if (check(i, j, k, l)) pr = 1;
  if (pr) {
    cout << "pq";
    if (pr == 1)
      cout << d1.first << " " << d1.second << " " << d2.first << " "
           << d2.second << "\n";
  }
  if (d1.second * d2.second + d2.first * d1.first == 0) return 1;
  return 0;
}
int main() {
  int n = 8, i, j, k, l, m;
  for (i = 0; i < n; i++) {
    cin >> p[i].first >> p[i].second;
    mp[p[i]] = i + 1;
  }
  sort(p, p + n);
  bool pr = 0;
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      for (k = j + 1; k < n; k++) {
        for (l = k + 1; l < n; l++) {
          int i1 = -1, j1 = -1, k1 = -1, l1 = -1;
          for (m = 0; m < n; m++) {
            if (m != i && m != j && m != k && m != l) {
              if (i1 < 0)
                i1 = m;
              else if (j1 < 0)
                j1 = m;
              else if (k1 < 0)
                k1 = m;
              else if (l1 < 0)
                l1 = m;
            }
          }
          bool b1 = checksq(i, j, k, l);
          bool b2 = checkrec(i1, j1, k1, l1);
          if (b1 && b2) {
            cout << "YES\n";
            cout << mp[p[i]] << " " << mp[p[j]] << " " << mp[p[k]] << " "
                 << mp[p[l]] << "\n";
            cout << mp[p[i1]] << " " << mp[p[j1]] << " " << mp[p[k1]] << " "
                 << mp[p[l1]] << "\n";
            return 0;
          }
          b1 = checkrec(i, j, k, l);
          b2 = checksq(i1, j1, k1, l1);
          if (b1 && b2) {
            cout << "YES\n";
            cout << mp[p[i1]] << " " << mp[p[j1]] << " " << mp[p[k1]] << " "
                 << mp[p[l1]] << "\n";
            cout << mp[p[i]] << " " << mp[p[j]] << " " << mp[p[k]] << " "
                 << mp[p[l]] << "\n";
            return 0;
          }
        }
      }
    }
  }
  cout << "NO\n";
  return 0;
}
