Problem: Little Petya very much likes rectangles and especially squares. Recently he has received 8 points on the plane as a gift from his mother. The points are pairwise distinct. Petya decided to split them into two sets each containing 4 points so that the points from the first set lay at the vertexes of some square and the points from the second set lay at the vertexes of a rectangle. Each point of initial 8 should belong to exactly one set. It is acceptable for a rectangle from the second set was also a square. If there are several partitions, Petya will be satisfied by any of them. Help him find such partition. Note that the rectangle and the square from the partition should have non-zero areas. The sides of the figures do not have to be parallel to the coordinate axes, though it might be the case.

Input

You are given 8 pairs of integers, a pair per line — the coordinates of the points Petya has. The absolute value of all coordinates does not exceed 104. It is guaranteed that no two points coincide.

Output

Print in the first output line "YES" (without the quotes), if the desired partition exists. In the second line output 4 space-separated numbers — point indexes from the input, which lie at the vertexes of the square. The points are numbered starting from 1. The numbers can be printed in any order. In the third line print the indexes of points lying at the vertexes of a rectangle in the similar format. All printed numbers should be pairwise distinct.

If the required partition does not exist, the first line should contain the word "NO" (without the quotes), after which no output is needed.

Examples

Input

0 0
10 11
10 0
0 11
1 1
2 2
2 1
1 2


Output

YES
5 6 7 8
1 2 3 4


Input

0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7


Output

NO


Input

0 0
4 4
4 0
0 4
1 2
2 3
3 2
2 1


Output

YES
1 2 3 4
5 6 7 8

Note

Pay attention to the third example: the figures do not necessarily have to be parallel to the coordinate axes.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
int x4[4] = {0, 0, -1, 1};
int y4[4] = {-1, 1, 0, 0};
int x8[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
int y8[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
int xhorse[8] = {1, 2, 1, 2, -1, -2, -1, -2};
int yhorse[8] = {2, 1, -2, -1, 2, 1, -2, -1};
using namespace std;
struct point {
  double x, y;
  point() { x = y = 0.0; }
  point(double _x, double _y) : x(_x), y(_y) {}
  bool operator<(point other) const {
    if (fabs(x - other.x) > 1e-11) return x < other.x;
    return y < other.y;
  }
  point operator+(point &p) { return point(x + p.x, y + p.y); }
  point operator-(point &p) { return point(x - p.x, y - p.y); }
  bool operator==(point &p) {
    return fabs(x - p.x) < 1e-11 && fabs(y - p.y) < 1e-11;
  }
};
struct point_3 {
  double x, y, z;
  point_3() { x = y = z = 0.0; }
  point_3(double _x, double _y, double _z) : x(_x), y(_y), z(_z) {}
};
struct line {
  double a, b, c;
};
struct vec {
  double x, y;
  vec() { x = y = 0.0; }
  vec(double _x, double _y) : x(_x), y(_y) {}
};
double _deg_to_rad(double d) { return d * M_PI / 180.0; }
double _rad_to_deg(double d) { return d * 180.0 / M_PI; }
vec _scale(vec v, double s) { return vec(v.x * s, v.y * s); }
double _dot(vec a, vec b) { return (a.x * b.x + a.y * b.y); }
double _cross(vec a, vec b) { return a.x * b.y - a.y * b.x; }
double _cross(const point &O, const point &A, const point &B) {
  return (A.x - O.x) * (B.y - O.y) - (A.y - O.y) * (B.x - O.x);
}
double _norm_sq(vec v) { return v.x * v.x + v.y * v.y; }
double _dist(point p1, point p2) {
  return sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));
}
double _dist_3(point_3 p1, point_3 p2) {
  return sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y) +
              (p1.z - p2.z) * (p1.z - p2.z));
}
point _rotate(point p, double thetaDegree, point center = point(0, 0)) {
  double rad = _deg_to_rad(thetaDegree);
  p = p - center;
  p = point(p.x * cos(rad) - p.y * sin(rad), p.x * sin(rad) + p.y * cos(rad));
  p = p + center;
  return p;
}
void _pointToLine(point p1, point p2, line &l) {
  if (fabs(p1.x - p2.x) < 1e-11) {
    l.a = 1.0;
    l.b = 0.0;
    l.c = -p1.x;
  } else {
    l.a = -(double)(p1.y - p2.y) / (p1.x - p2.x);
    l.b = 1.0;
    l.c = -(double)(l.a * p1.x) - p1.y;
  }
}
void _pointToVec(point a, point b, vec &v) {
  v.x = b.x - a.x;
  v.y = b.y - a.y;
}
point _translate(point p, vec v) { return point(p.x + v.x, p.y + v.y); }
bool _collinear(point p, point q, point r) {
  vec pq, pr;
  _pointToVec(p, q, pq);
  _pointToVec(p, r, pr);
  return fabs(_cross(pq, pr)) < 1e-11;
}
bool _areParallel(line l1, line l2) {
  return ((fabs(l1.a - l2.a) < 1e-11) && (fabs(l1.b - l2.b) < 1e-11)) ||
         (fabs(l1.a) < 1e-11 && fabs(l2.a) < 1e-11) ||
         (fabs(l1.b) < 1e-11 && fabs(l2.b) < 1e-11);
}
bool _areSame(line l1, line l2) {
  return _areParallel(l1, l2) && (fabs(l1.c - l2.c) < 1e-11);
}
bool _onSegment(point a, point b, point k) {
  if (!_collinear(a, b, k)) return false;
  if (min(a.x, b.x) <= k.x && max(a.x, b.x) >= k.x && min(a.y, b.y) <= k.y &&
      max(a.y, b.y) >= k.y)
    return true;
  return false;
}
bool _areIntersect(line l1, line l2, point &p) {
  if (_areParallel(l1, l2)) return false;
  p.x = (l2.b * l1.c - l1.b * l2.c) / (l2.a * l1.b - l1.a * l2.b);
  if (fabs(l1.b) > 1e-11)
    p.y = -(l1.a * p.x + l1.c) / l1.b;
  else
    p.y = -(l2.a * p.x + l2.c) / l2.b;
  return true;
}
bool _areIntersect(point s1, point f1, point s2, point f2, point &p) {
  line l1, l2;
  _pointToLine(s1, f1, l1);
  _pointToLine(s2, f2, l2);
  if (!_areIntersect(l1, l2, p)) return false;
  if (_onSegment(s1, f1, p) && _onSegment(s2, f2, p)) return true;
  return false;
}
double _distToLine(point p, point a, point b, point &c) {
  vec ap, ab;
  _pointToVec(a, p, ap);
  _pointToVec(a, b, ab);
  double u = _dot(ap, ab) / _norm_sq(ab);
  c = _translate(a, _scale(ab, u));
  return _dist(p, c);
}
double _distToLineSegment(point p, point a, point b, point &c) {
  vec ap, ab;
  _pointToVec(a, p, ap);
  _pointToVec(a, b, ab);
  double u = _dot(ap, ab) / _norm_sq(ab);
  if (u < 0.0) {
    c = point(a.x, a.y);
    return _dist(p, a);
  }
  if (u > 1.0) {
    c = point(b.x, b.y);
    return _dist(p, b);
  }
  return _distToLine(p, a, b, c);
}
double _angle(point a, point o, point b) {
  vec oa, ob;
  _pointToVec(o, a, oa);
  _pointToVec(o, b, ob);
  return acos(_dot(oa, ob) / sqrt(_norm_sq(oa) * _norm_sq(ob)));
}
bool _ccw(point p, point q, point r) {
  vec pq, pr;
  _pointToVec(p, q, pq);
  _pointToVec(p, r, pr);
  return _cross(pq, pr) > 0;
}
int _insideCircle(point p, point center, double r) {
  double dx = p.x - center.x, dy = p.y - center.y;
  double Euc = dx * dx + dy * dy, rSq = r * r;
  return Euc < rSq ? 0 : Euc == rSq ? 1 : 2;
}
bool _circle_2_points_radius(point p1, point p2, double r, point &c) {
  double d2 = (p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y);
  double det = r * r / d2 - 0.25;
  if (det < 0.0) return false;
  double h = sqrt(det);
  c.x = (p1.x + p2.x) * 0.5 + (p1.y - p2.y) * h;
  c.y = (p1.y + p2.y) * 0.5 + (p2.x - p1.x) * h;
  return true;
}
double _perimeter(double a, double b, double c) { return a + b + c; }
double _perimeter(const vector<point> &P) {
  double result = 0.0;
  for (int i = 0; i < (int)P.size() - 1; i++) result += _dist(P[i], P[i + 1]);
  return result;
}
double _area(double a, double b, double c) {
  double s = _perimeter(a, b, c) / 2;
  return sqrt(s * (s - a) * (s - b) * (s - c));
}
double _area(const vector<point> &P) {
  double result = 0.0, x1, y1, x2, y2;
  for (int i = 0; i < (int)P.size() - 1; i++) {
    x1 = P[i].x;
    x2 = P[i + 1].x;
    y1 = P[i].y;
    y2 = P[i + 1].y;
    result += (x1 * y2 - x2 * y1);
  }
  return fabs(result) / 2.0;
}
double _rInCircle(double ab, double bc, double ca) {
  return _area(ab, bc, ca) / (0.5 * _perimeter(ab, bc, ca));
}
double _rInCircle(point a, point b, point c) {
  return _rInCircle(_dist(a, b), _dist(b, c), _dist(c, a));
}
double _rInCircleIsosceles(double base, double height) {
  return base * height / (2 * sqrt(height * height + base * base / 4) + base);
}
double _rInCircleEquilateral(double sideLength) {
  return sideLength * sqrt(3) / 6;
}
double _rCircumCircle(double ab, double bc, double ca) {
  return ab * bc * ca / (4.0 * _area(ab, bc, ca));
}
double _rCircumCircle(point a, point b, point c) {
  return _rCircumCircle(_dist(a, b), _dist(b, c), _dist(c, a));
}
int _inCircle(point p1, point p2, point p3, point &center, double &r) {
  r = _rInCircle(p1, p2, p3);
  if (fabs(r) < 1e-11) return 0;
  vec temp;
  line l1, l2;
  double ratio = _dist(p1, p2) / _dist(p1, p3);
  _pointToVec(p2, p3, temp);
  point p = _translate(p2, _scale(temp, ratio / (1 + ratio)));
  _pointToLine(p1, p, l1);
  ratio = _dist(p2, p1) / _dist(p2, p3);
  _pointToVec(p1, p3, temp);
  p = _translate(p1, _scale(temp, ratio / (1 + ratio)));
  _pointToLine(p2, p, l2);
  _areIntersect(l1, l2, center);
  return 1;
}
vector<point> _convexHull(vector<point> 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 && _cross(H[k - 2], H[k - 1], P[i]) <= 0) k--;
    H[k++] = P[i];
  }
  for (int i = n - 2, t = k + 1; i >= 0; i--) {
    while (k >= t && _cross(H[k - 2], H[k - 1], P[i]) <= 0) k--;
    H[k++] = P[i];
  }
  H.resize(k);
  return H;
}
bool _inPolygon(point pt, const vector<point> &P) {
  if (P.size() == 0) return false;
  double sum = 0;
  for (int i = 0; i < P.size() - 1; i++) {
    if (_ccw(pt, P[i], P[i + 1]))
      sum += _angle(P[i], pt, P[i + 1]);
    else
      sum -= _angle(P[i], pt, P[i + 1]);
  }
  return fabs(fabs(sum) - 2 * M_PI) < 1e-11;
}
vector<point> _cutPolygon(point a, point b, const vector<point> &Q) {
  vector<point> P;
  for (int i = 0; i < Q.size(); i++) {
    point po;
    vec v1, v2;
    _pointToVec(a, b, v1);
    _pointToVec(a, Q[i], v2);
    double left1 = _cross(v1, v2), left2 = 0;
    if (i != (int)Q.size() - 1) _pointToVec(a, b, v1);
    _pointToVec(a, Q[i + 1], v2);
    left2 = _cross(v1, v2);
    if (left1 > -1e-11) P.push_back(Q[i]);
    if (left1 * left2 < -1e-11) {
      _areIntersect(Q[i], Q[i + 1], a, b, po);
      P.push_back(po);
    }
  }
  if (!P.empty() && !(P.back() == P.front())) P.push_back(P.front());
  return P;
}
point p[8];
int check(vector<point> P) {
  for (int i = 0; i < P.size() - 2; i++) {
    double degree = _rad_to_deg(_angle(P[i], P[i + 1], P[i + 2]));
    if (fabs(degree - 90.0) > 1e-11) return 0;
  }
  double dist = _dist(P[0], P[1]);
  for (int i = 0; i < P.size() - 1; i++) {
    if (fabs(_dist(P[i], P[i + 1]) - dist) > 1e-11) return 2;
  }
  return 1;
}
int main() {
  for (int i = 0; i < 8; i++) scanf("%lf %lf", &p[i].x, &p[i].y);
  vector<point> group[2];
  vector<int> ans[2];
  int max_mask = 255;
  for (int i = 0; i <= max_mask; i++) {
    group[0].clear();
    group[1].clear();
    ans[0].clear();
    ans[1].clear();
    for (int j = 0; j < 8; j++)
      group[(i >> j) & 1].push_back(p[j]), ans[(i >> j) & 1].push_back(j);
    if (group[0].size() != 4 || group[1].size() != 4) continue;
    group[0] = _convexHull(group[0]);
    group[1] = _convexHull(group[1]);
    int res0 = check(group[0]);
    int res1 = check(group[1]);
    if (res0 == 0 || res1 == 0) continue;
    if (res0 == 2 && res1 == 2) continue;
    int sq, rec;
    if (res0 == 1)
      sq = 0, rec = 1;
    else
      sq = 1, rec = 0;
    printf("YES\n");
    for (int j = 0; j < ans[sq].size(); j++) printf("%d ", ans[sq][j] + 1);
    printf("\n");
    for (int j = 0; j < ans[rec].size(); j++) printf("%d ", ans[rec][j] + 1);
    printf("\n");
    return 0;
  }
  printf("NO\n");
  return 0;
}