#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7, INF = 1e18, mx = 1e6;
int testCase = 1, cas = 0;
long long Dis[10][10];
vector<pair<long long, long long> > P;
long long F(int i, int j) {
  int x1 = P[i].first;
  int y1 = P[i].second;
  int x2 = P[j].first;
  int y2 = P[j].second;
  return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
}
int main() {
  ios_base ::sync_with_stdio(0), cin.tie(0);
  for (int i = 0; i < 8; i++) {
    long long x, y;
    cin >> x >> y;
    P.push_back({x, y});
  }
  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 8; j++) {
      long long d = F(i, j);
      Dis[i][j] = d;
    }
  }
  int ok = 1;
  for (int i = 0; ok && i < 8; i++) {
    for (int j = 0; ok && j < 8; j++) {
      if (i == j) continue;
      for (int k = 0; ok && k < 8; k++) {
        if (k == i || k == j) continue;
        for (int l = 0; ok && l < 8; l++) {
          if (l == i || l == j || l == k) continue;
          if (Dis[i][j] == Dis[j][k] && Dis[j][k] == Dis[k][l] &&
              Dis[k][l] == Dis[l][i] && Dis[l][j] == Dis[i][k]) {
            vector<int> R;
            for (int m = 0; m < 8; m++) {
              if (m == i || m == j || m == k || m == l) continue;
              R.push_back(m);
            }
            int flag = 0;
            for (int ii = 0; !flag && ii < 4; ii++) {
              for (int jj = 0; !flag && jj < 4; jj++) {
                if (ii == jj) continue;
                for (int kk = 0; !flag && kk < 4; kk++) {
                  if (kk == ii || kk == jj) continue;
                  for (int mm = 0; !flag && mm < 4; mm++) {
                    if (mm == ii || mm == jj || mm == kk) continue;
                    if (Dis[R[ii]][R[jj]] == Dis[R[kk]][R[mm]] &&
                        Dis[R[ii]][R[kk]] == Dis[R[jj]][R[mm]] &&
                        Dis[R[ii]][R[mm]] == Dis[R[jj]][R[kk]])
                      flag = 1;
                  }
                }
              }
            }
            if (flag) {
              ok = 0;
              cout << "YES" << endl;
              cout << i + 1 << " " << j + 1 << " " << k + 1 << " " << l + 1
                   << endl;
              cout << R[0] + 1 << " " << R[1] + 1 << " " << R[2] + 1 << " "
                   << R[3] + 1 << endl;
            }
          }
        }
      }
    }
  }
  if (ok) cout << "NO" << endl;
  return 0;
}
