#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const double PI = acos(-1.0);
template <class T>
class Point {
 public:
  T x, y;
  Point(){};
  Point(long double x, long double y) {
    this->x = x;
    this->y = y;
  }
  Point operator+(const Point &b) const { return Point(x + b.x, y + b.y); }
  Point operator-(const Point &b) const { return Point(x - b.x, y - b.y); }
  Point operator+=(const Point &b) {
    this->x += b.x;
    this->y += b.y;
    return Point(this->x, this->y);
  }
  Point operator-=(const Point &b) {
    this->x -= b.x;
    this->y -= b.y;
    return Point(this->x, this->y);
  }
  bool operator==(const Point &b) const {
    return (abs(x - b.x) < EPS and abs(y - b.y) < EPS);
  }
  bool operator<(const Point &b) const {
    return (x < b.x or (x == b.x and y < b.y));
  }
  T operator*(const Point &b) const {
    return (this->x * b.x) + (this->y * b.y);
  }
  T operator^(const Point &b) const {
    return (this->x * b.y) - (this->y * b.x);
  }
  Point operator/(T k) const {
    if (k == 0) cout << "Dividisão por 0" << endl;
    return Point(x / k, y / k);
  }
  Point operator*(T k) const { return Point(x * k, y * k); }
  T tamanho() const { return sqrt(x * x + y * y); }
  T tamanho2() { return x * x + y * y; }
  T dpp2(const Point &b) const { return ((*this) - b).tamanho2(); }
  T dpp(const Point &b) const { return ((*this) - b).tamanho(); }
  static T area(vector<Point> v) {
    T area = 0.0;
    for (int i = 0; i < (int)v.size(); i++)
      area += v[i] ^ v[(i + 1) % v.size()];
    return abs(area / 2.0);
  }
  static bool inside(const vector<Point> &v, const Point &p) {
    int n = v.size();
    if (n < 3) return false;
    if (((v[1] - v[0]) ^ (p - v[0])) < 0) return false;
    int bot = 2, top = n - 1;
    int ans = -1;
    while (bot <= top) {
      int mid = (bot + top) >> 1;
      if (((v[mid] - v[0]) ^ (p - v[0])) <= 0) {
        ans = mid;
        top = mid - 1;
      } else {
        bot = mid + 1;
      }
    }
    if (ans == -1) return false;
    if (((v[ans] - v[ans - 1]) ^ (p - v[ans - 1])) < 0) return false;
    return true;
  }
  static vector<Point> convex_hull(vector<Point> p) {
    if (p.size() <= 2) return p;
    int n = p.size(), k = 0;
    vector<Point> H(2 * n);
    sort(p.begin(), p.end());
    for (int i = 0; i < n; i++) {
      while (k >= 2 and ((H[k - 1] - H[k - 2]) ^ (p[i] - H[k - 2])) <= 0.0) k--;
      H[k++] = p[i];
    }
    for (int i = n - 2, t = k + 1; i >= 0; i--) {
      while (k >= t and ((H[k - 1] - H[k - 2]) ^ (p[i] - H[k - 2])) <= 0.0) k--;
      H[k++] = p[i];
    }
    H.resize(k - 1);
    return H;
  }
};
template <class T>
T getAreaTriangle(T a, T b, T c) {
  T p = (a + b + c) / 2.0;
  return sqrt(p * (p - a) * (p - b) * (p - c));
}
vector<Point<int> > todos;
void back(int bitmask, int quant, int posi) {
  if (quant == 4) {
    std::vector<Point<int> > tentativaq, tentativar;
    std::vector<int> respq, respr;
    int auxposi = 0;
    while (bitmask != 0) {
      if (bitmask % 2 == 1) {
        tentativaq.push_back(todos[auxposi]);
        respq.push_back(auxposi);
      } else {
        tentativar.push_back(todos[auxposi]);
        respr.push_back(auxposi);
      }
      auxposi++;
      bitmask /= 2;
    }
    for (int i = auxposi; i < 8; i++) {
      tentativar.push_back(todos[i]);
      respr.push_back(i);
    }
    bool quadrado = true;
    bool retangulo = true;
    tentativar = tentativar[0].convex_hull(tentativar);
    tentativaq = tentativaq[0].convex_hull(tentativaq);
    int dist = tentativaq[0].dpp2(tentativaq[1]);
    for (int i = 0; i < 4; i++) {
      if (tentativaq[i].dpp2(tentativaq[(i + 1) % 4]) != dist) quadrado = false;
    }
    int dist1, dist2;
    dist1 = tentativar[0].dpp2(tentativar[1]);
    dist2 = tentativar[1].dpp2(tentativar[2]);
    if (tentativar[2].dpp2(tentativar[3]) != dist1 or
        tentativar[3].dpp2(tentativar[0]) != dist2)
      retangulo = false;
    int distdr = tentativar[0].dpp2(tentativar[2]);
    int distdq = tentativaq[0].dpp2(tentativaq[2]);
    if (tentativaq[1].dpp2(tentativaq[3]) != distdq) quadrado = false;
    if (tentativar[1].dpp2(tentativar[3]) != distdr) retangulo = false;
    if (retangulo == true and quadrado == true) {
      cout << "YES" << endl;
      for (int i = 0; i < 4; i++) cout << respq[i] + 1 << " ";
      cout << endl;
      for (int i = 0; i < 4; i++) cout << respr[i] + 1 << " ";
      cout << endl;
      exit(0);
    }
    return;
  }
  if (posi == 8) return;
  back((bitmask + (1 << posi)), quant + 1, posi + 1);
  back(bitmask, quant, posi + 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  ;
  for (int i = 0; i < 8; i++) {
    int x, y;
    cin >> x >> y;
    Point<int> aux;
    aux.x = x;
    aux.y = y;
    todos.push_back(aux);
  }
  back(0, 0, 0);
  cout << "NO" << endl;
  return 0;
}
