#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T myabs(T x) {
  return (x > 0 ? x : -x);
}
template <class T>
string tostring(T x) {
  ostringstream q;
  q << x;
  return q.str();
}
int strtoint(string x) {
  istringstream q(x);
  int res;
  q >> res;
  return res;
}
const int INF = 0x7FFFFFFF;
bool res = false;
int w[11];
int e[111];
int resa[111];
int resb[111];
int x[111], y[111];
inline long long sqr(long long x) { return x * x; }
inline long long dist(long long x1, long long y1, int x2, int y2) {
  return sqr(x1 - x2) + sqr(y1 - y2);
}
inline bool isparalel(int x1, int y1, int x2, int y2, int x3, int y3, int x4,
                      int y4) {
  int a1 = y1 - y2;
  int b1 = x2 - x1;
  int c1 = -a1 * x1 - b1 * y1;
  int a2 = y3 - y4;
  int b2 = x4 - x3;
  int c2 = -a2 * x3 - b2 * y3;
  if (a1 * b2 == a2 * b1 && (b1 * c2 != b2 * c1 || a1 * c2 != a2 * c1))
    return true;
  else
    return false;
}
bool rect = false;
int xx[111], yy[111];
bool used[11];
int ww[11];
bool kvadrat = false;
void isrect(int v) {
  if (v == 4) {
    int x1 = xx[ww[0]];
    int y1 = yy[ww[0]];
    int x2 = xx[ww[1]];
    int y2 = yy[ww[1]];
    int x3 = xx[ww[2]];
    int y3 = yy[ww[2]];
    int x4 = xx[ww[3]];
    int y4 = yy[ww[3]];
    if (isparalel(x1, y1, x2, y2, x3, y3, x4, y4) &&
        isparalel(x2, y2, x3, y3, x1, y1, x4, y4)) {
      if (dist(x1, y1, x3, y3) == dist(x2, y2, x4, y4)) {
        rect = true;
        int q1 = dist(x1, y1, x2, y2);
        int q2 = dist(x2, y2, x3, y3);
        int q3 = dist(x3, y3, x4, y4);
        int q4 = dist(x4, y4, x1, y1);
        if (q1 == q2 && q2 == q3 && q3 == q4 && q4 == q1) kvadrat = true;
      }
    }
    return;
  }
  for (int i = 0; i < 4; ++i) {
    if (!used[i]) {
      used[i] = true;
      ww[v] = i;
      isrect(v + 1);
      used[i] = false;
    }
  }
}
bool isrectangle(int x1, int y1, int x2, int y2, int x3, int y3, int x4,
                 int y4) {
  rect = false;
  xx[0] = x1;
  yy[0] = y1;
  xx[1] = x2;
  yy[1] = y2;
  xx[2] = x3;
  yy[2] = y3;
  xx[3] = x4;
  yy[3] = y4;
  isrect(0);
  if (rect) return true;
  if (isparalel(x1, y1, x2, y2, x3, y3, x4, y4) &&
      isparalel(x2, y2, x3, y3, x1, y1, x4, y4)) {
    if (dist(x1, y1, x3, y3) == dist(x2, y2, x4, y4)) {
      return true;
    }
  }
  return false;
}
void rec(int v) {
  if (v == 8) {
    if (w[0] == 1 && w[1] == 1 && w[2] == 1 && w[3] == 1 && w[4] == 0 &&
        w[5] == 0 && w[6] == 0) {
      int qw = 1;
    }
    int k = 0;
    for (int i = 0; i < 8; ++i) {
      if (w[i] == 0) e[k++] = i;
    }
    if (k != 4) return;
    kvadrat = false;
    if (isrectangle(x[e[0]], y[e[0]], x[e[1]], y[e[1]], x[e[2]], y[e[2]],
                    x[e[3]], y[e[3]])) {
      if (kvadrat)
        ;
      else
        return;
    } else
      return;
    k = 0;
    for (int i = 0; i < 8; ++i) {
      if (w[i] == 1) e[k++] = i;
    }
    if (k != 4) return;
    if (isrectangle(x[e[0]], y[e[0]], x[e[1]], y[e[1]], x[e[2]], y[e[2]],
                    x[e[3]], y[e[3]]))
      ;
    else
      return;
    res = true;
    k = 0;
    int r = 0;
    for (int i = 0; i < 8; ++i) {
      if (w[i] == 0) {
        resa[k++] = i + 1;
      } else
        resb[r++] = i + 1;
    }
    return;
  }
  w[v] = 0;
  rec(v + 1);
  w[v] = 1;
  rec(v + 1);
}
int main() {
  for (int i = 0; i < 8; ++i) {
    cin >> x[i] >> y[i];
  }
  rec(0);
  if (res) {
    cout << "YES" << endl;
    for (int i = 0; i < 4; ++i) cout << resa[i] << " ";
    cout << endl;
    for (int i = 0; i < 4; ++i) cout << resb[i] << " ";
    cout << endl;
  } else
    cout << "NO" << endl;
  return 0;
}
