#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:268435456")
using namespace std;
template <class T>
T abs(T &x) {
  return (x >= 0) ? (x) : (-x);
}
template <class T>
T sqr(T &x) {
  return (x) * (x);
}
template <class T>
T min(T &a, T &b) {
  return (a < b) ? (a) : (b);
}
template <class T>
T max(T &a, T &b) {
  return (a > b) ? (a) : (b);
}
long long x[10], y[10];
int p[10], q[10];
long long xx[10], yy[10];
long long xxx[10], yyy[10];
long long len2[10];
long long sqDist(long long x1, long long y1, long long x2, long long y2) {
  long long dx = x1 - x2;
  long long dy = y1 - y2;
  return dx * dx + dy * dy;
}
long long getDoubleArea() {
  long long res = 0;
  for (int i = 0; i < 4; i++) {
    int j = (i + 1) % 4;
    res += xxx[i] * yyy[j] - xxx[j] * yyy[i];
  }
  return abs(res);
}
bool checkRect() {
  for (int i = 0; i < 4; i++) {
    xxx[i] = xx[q[i]];
    yyy[i] = yy[q[i]];
  }
  long long doubleArea = getDoubleArea();
  if (doubleArea == 0) return false;
  for (int i = 0; i < 4; i++) {
    int j = (i + 1) % 4;
    len2[i] = sqDist(xxx[i], yyy[i], xxx[j], yyy[j]);
  }
  if (len2[0] != len2[2]) return false;
  if (len2[1] != len2[3]) return false;
  long long a2 = len2[0], b2 = len2[1];
  if (a2 * b2 * 4 != doubleArea * doubleArea) return false;
  return true;
}
bool checkSq() {
  for (int i = 0; i < 4; i++) {
    xxx[i] = xx[q[i]];
    yyy[i] = yy[q[i]];
  }
  long long doubleArea = getDoubleArea();
  if (doubleArea == 0) return false;
  for (int i = 0; i < 4; i++) {
    int j = (i + 1) % 4;
    len2[i] = sqDist(xxx[i], yyy[i], xxx[j], yyy[j]);
  }
  for (int i = 0; i < 4; i++)
    if (2 * len2[i] != doubleArea) return false;
  return true;
}
bool sqResult, rectResult;
void genSq(int L, int R) {
  if (L == R) {
    if (checkSq()) sqResult = true;
  } else {
    for (int i = L; i <= R; i++) {
      swap(q[i], q[L]);
      genSq(L + 1, R);
      swap(q[i], q[L]);
    }
  }
}
void genRect(int L, int R) {
  if (L == R) {
    if (checkRect()) rectResult = true;
  } else {
    for (int i = L; i <= R; i++) {
      swap(q[i], q[L]);
      genRect(L + 1, R);
      swap(q[i], q[L]);
    }
  }
}
bool isRect() {
  for (int i = 0; i < 4; i++) {
    xx[i] = x[p[i + 4]];
    yy[i] = y[p[i + 4]];
    q[i] = i;
  }
  rectResult = false;
  genRect(0, 3);
  return rectResult;
}
bool isSquare() {
  for (int i = 0; i < 4; i++) {
    xx[i] = x[p[i]];
    yy[i] = y[p[i]];
    q[i] = i;
  }
  sqResult = false;
  genSq(0, 3);
  return sqResult;
}
bool check() {
  bool res = true;
  if (!isSquare()) res = false;
  if (!isRect()) res = false;
  return res;
}
bool found = false;
void gen(int L, int R) {
  if (found) return;
  if (L == R) {
    if (check()) {
      found = true;
      return;
    }
  } else {
    for (int i = L; i <= R; i++) {
      swap(p[i], p[L]);
      gen(L + 1, R);
      if (found) return;
      swap(p[i], p[L]);
    }
  }
}
int main() {
  for (int i = 0; i < 8; i++) cin >> x[i] >> y[i];
  for (int i = 0; i < 8; i++) p[i] = i;
  gen(0, 7);
  if (found) {
    cout << "YES" << endl;
    for (int i = 0; i < 4; i++) cout << p[i] + 1 << " ";
    cout << endl;
    for (int i = 4; i < 8; i++) cout << p[i] + 1 << " ";
    cout << endl;
  } else
    cout << "NO";
}
