#include <bits/stdc++.h>
const long double pi = 3.14159265358979323846;
using namespace std;
long long fact(long long n) {
  long long f = 1;
  for (long long i = n; i >= 1; i--) f *= i;
  return f;
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool prime(int n) {
  if (n == 1) return false;
  for (long long i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
int divisor(int n) {
  int r = 0, x = sqrt(n), ar[10000], sum = 0;
  if (x * x == n) ar[r++] = x;
  for (int i = 1; i <= x; i++)
    if (n % i == 0) ar[r++] = i, ar[r++] = n / i;
  for (int i = 0; i < r; i++)
    if (prime(ar[i])) sum += ar[i];
  return sum;
}
bool palindrome_str(string n) {
  string s = n;
  reverse(s.begin(), s.end());
  if (s == n) return true;
  return false;
}
bool palindrome_num(int n) {
  string s;
  string x = s;
  reverse(x.begin(), s.end());
  if (x == s) return true;
  return false;
}
void small(string &n) {
  for (int i = 0; i < n.size(); i++)
    if (n[i] >= 'A' && n[i] <= 'Z') n[i] += 32;
}
void capital(string &n) {
  for (int i = 0; i < n.size(); i++)
    if (n[i] >= 'a' && n[i] <= 'z') n[i] -= 32;
}
int convert_int(string s) {
  stringstream ss(s);
  int x;
  ss >> x;
  return x;
}
string convert_string(int x) {
  stringstream ss;
  string s;
  ss << x;
  s = ss.str();
  return s;
}
long long fast_power(long long n, long long m) {
  if (m == 0) return 0;
  if (m == 1) return n;
  long long x = fast_power(n, m / 2) % 1000000007;
  x = (x * x) % 1000000007;
  if (m % 2 != 0) x *= n;
  x %= 1000000007;
  return x;
}
void fast() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
int x[8], y[8];
int s[4], r[4];
bool square(int i, int j, int k, int l) {
  double ab = sqrt(pow((x[i] - x[j]), 2) + pow((y[i] - y[j]), 2));
  double bc = sqrt(pow((x[j] - x[k]), 2) + pow((y[j] - y[k]), 2));
  double cd = sqrt(pow((x[k] - x[l]), 2) + pow((y[k] - y[l]), 2));
  double da = sqrt(pow((x[l] - x[i]), 2) + pow((y[l] - y[i]), 2));
  double ac = sqrt(pow((x[i] - x[k]), 2) + pow((y[i] - y[k]), 2));
  double bd = sqrt(pow((x[j] - x[l]), 2) + pow((y[j] - y[l]), 2));
  if (ab == bc && bc == cd && cd == da && ac == bd) return 1;
  return 0;
}
bool rect(int i, int j, int k, int l) {
  double ab = sqrt(pow((x[i] - x[j]), 2) + pow((y[i] - y[j]), 2));
  double bc = sqrt(pow((x[j] - x[k]), 2) + pow((y[j] - y[k]), 2));
  double cd = sqrt(pow((x[k] - x[l]), 2) + pow((y[k] - y[l]), 2));
  double da = sqrt(pow((x[l] - x[i]), 2) + pow((y[l] - y[i]), 2));
  double ac = sqrt(pow((x[i] - x[k]), 2) + pow((y[i] - y[k]), 2));
  double bd = sqrt(pow((x[j] - x[l]), 2) + pow((y[j] - y[l]), 2));
  if (ac == bd && ab == cd && bc == da) return 1;
  return 0;
}
int main() {
  for (int i = 0; i < 8; i++) cin >> x[i] >> y[i];
  bool f1 = 0, f2 = 0;
  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 8; j++) {
      for (int k = 0; k < 8; k++) {
        for (int l = 0; l < 8; l++) {
          if (i != j && i != k && i != l && j != k && j != l && k != l)
            f1 = square(i, j, k, l);
          if (f1) {
            s[0] = i;
            s[1] = j;
            s[2] = k;
            s[3] = l;
            break;
          }
        }
        if (f1) break;
      }
      if (f1) break;
    }
    if (f1) break;
  }
  if (!f1)
    cout << "NO\n";
  else {
    int c = 0;
    sort(s, s + 4);
    for (int i = 0; i < 8; i++)
      if (i != s[0] && i != s[1] && i != s[2] && i != s[3]) r[c++] = i;
    sort(r, r + 4);
    do {
      f2 = rect(r[0], r[1], r[2], r[3]);
      if (f2) break;
    } while (next_permutation(r, r + 4));
    if (f1 && f2) {
      cout << "YES\n";
      for (int i = 0; i < 4; i++) cout << s[i] + 1 << " ";
      cout << endl;
      for (int i = 0; i < 4; i++) cout << r[i] + 1 << " ";
      cout << endl;
    } else
      cout << "NO\n";
  }
}
