#include <bits/stdc++.h>   using namespace std;   class Point {    public:     int x;     int y;     Point(int x = 0, int y = 0) : x(x), y(y) {}     friend Point operator-(Point a, Point b) {       return Point(b.x - a.x, b.y - a.y);     }   };   int getBit(int mask, int num) { return ((mask & (1 << num)) ? 1 : 0); }   int innerProduct(Point a, Point b) { return a.x * b.x + a.y * b.y; }   int sqr(int x) { return x * x; }   int squareDist(Point a, Point b) { return sqr(a.x - b.x) + sqr(b.y - a.y); }   bool checkEdges(vector<Point> figure) {     figure.push_back(figure.front());     figure.push_back(*(figure.begin() + 1));     for (int i = 0; i + 2 < figure.size(); ++i)       if (innerProduct(figure[i + 1] - figure[i],                        figure[i + 2] - figure[i + 1]) != 0)         return false;     return true;   }   bool checkEdgesEquality(vector<Point> figure) {     figure.push_back(figure.front());     for (int i = 0; i + 2 < figure.size(); ++i)       if (squareDist(figure[i], figure[i + 1]) !=           squareDist(figure[i + 1], figure[i + 2]))         return false;     return true;   }   bool checkRectangleEdges(vector<Point> figure) {     figure.push_back(figure.front());     if (squareDist(figure[0], figure[1]) == squareDist(figure[2], figure[3]) &&         squareDist(figure[1], figure[2]) == squareDist(figure[3], figure[4]))       return true;     else       return false;   }   bool checkSquare(vector<Point> square) {     vector<int> sm;     sm.push_back(0);     sm.push_back(1);     sm.push_back(2);     sm.push_back(3);     do {       vector<Point> sq;       for (int i = 0; i < 4; ++i) sq.push_back(square[sm[i]]);       if (checkEdges(sq) && checkEdgesEquality(sq)) return true;     } while (next_permutation(sm.begin(), sm.end()));     return false;   }   bool checkRectangle(vector<Point> rectangle) {     vector<int> sm;     sm.push_back(0);     sm.push_back(1);     sm.push_back(2);     sm.push_back(3);     do {       vector<Point> sq;       for (int i = 0; i < 4; ++i) sq.push_back(rectangle[sm[i]]);       if (checkEdges(sq) && checkRectangleEdges(sq)) return true;     } while (next_permutation(sm.begin(), sm.end()));     return false;   }   bool check(vector<Point> square, vector<Point> rectangle) {     if (checkSquare(square) && checkRectangle(rectangle)) return true;     return false;   }   int main() {     vector<Point> v;     int a, b;     for (int i = 0; i < 8; ++i) {       cin >> a >> b;       v.push_back(Point(a, b));     }     int i = 0;     while (i < 1 << 8) {       vector<Point> square, rectangle;       vector<int> resSquare, resRectangle;       for (int j = 0; j < 8; ++j) {         if (getBit(i, j))           square.push_back(v[j]);         else           rectangle.push_back(v[j]);       }       if (square.size() == 4 && rectangle.size() == 4 &&           check(square, rectangle)) {         for (int j = 0; j < 8; ++j) {           if (getBit(i, j))             resSquare.push_back(j);           else             resRectangle.push_back(j);         }         cout <<  YES  << endl;         for (int j = 0; j < 4; ++j) cout << resSquare[j] + 1 <<    ;         cout << endl;         for (int j = 0; j < 4; ++j) cout << resRectangle[j] + 1 <<    ;         return 0;       }       ++i;     }     cout <<  NO ;     return 0;   }