#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const double pi = acos(-1);
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
const int mod = 1000 * 1000 * 1000 + 7;
pair<pair<int, int>, int> arr[10];
int getDis(pair<int, int> a, pair<int, int> b) {
  return (a.first - b.first) * (a.first - b.first) +
         (a.second - b.second) * (a.second - b.second);
}
bool isSq(pair<int, int> a, pair<int, int> b, pair<int, int> c,
          pair<int, int> d) {
  if (getDis(a, b) != getDis(b, c)) return false;
  if (getDis(b, c) != getDis(c, d)) return false;
  if (getDis(c, d) != getDis(d, a)) return false;
  if (getDis(d, a) != getDis(a, b)) return false;
  if (getDis(a, c) != getDis(b, d)) return false;
  return true;
}
bool isRc(pair<int, int> a, pair<int, int> b, pair<int, int> c,
          pair<int, int> d) {
  if (getDis(a, b) != getDis(c, d)) return false;
  if (getDis(a, d) != getDis(b, c)) return false;
  if (getDis(a, c) != getDis(b, d)) return false;
  return true;
}
int main() {
  for (int i = 1; i <= 8; ++i) {
    scanf("%d%d", &arr[i].first.first, &arr[i].first.second);
    arr[i].second = i;
  }
  sort(arr + 1, arr + 8 + 1);
  do {
    if (!isSq(arr[1].first, arr[2].first, arr[3].first, arr[4].first)) continue;
    if (!isRc(arr[5].first, arr[6].first, arr[7].first, arr[8].first)) continue;
    cout << "YES\n";
    cout << arr[1].second << " " << arr[2].second << " " << arr[3].second << " "
         << arr[4].second << endl;
    cout << arr[5].second << " " << arr[6].second << " " << arr[7].second << " "
         << arr[8].second << endl;
    return 0;
  } while (next_permutation(arr + 1, arr + 8 + 1));
  cout << "NO\n";
  return 0;
}
