import static java.lang.Math.*;
import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;
import static java.lang.System.arraycopy;
import static java.util.Arrays.sort;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.fill;
import java.util.*;
import java.io.*;

public class Main {

    public static void main(String[] args) throws IOException {
        try {
            if (new File("input.txt").exists())
                System.setIn(new FileInputStream("input.txt"));
        } catch (SecurityException e) {
        }
        new Main().run();
    }

    BufferedReader in;
    PrintWriter out;
    StringTokenizer st = new StringTokenizer("");

    private void run() throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        in.close();
        out.close();
    }

    final double EPS = 1e-9;

    class Point implements Comparable<Point>{
        long x,y;

        public Point(long x, long y) {
            super();
            this.x = x;
            this.y = y;
        }

        public double dist(Point o) {
            return sqrt( (x - o.x) * (x - o.x) + (y - o.y) * (y - o.y) );
        }

        @Override
        public int compareTo(Point o) {
            if (x != o.x)
                return Long.compare(x, o.x);
            return Long.compare(y, o.y);
        }
    }

    long scalarMul(Point middle, Point a, Point b) {
        return (a.x - middle.x) * (b.x - middle.x) + (a.y - middle.y) * (b.y - middle.y);
    }

    boolean isRectangle(Point[] point) {
        sort(point);
        return (scalarMul(point[0], point[1], point[2]) == 0) && (scalarMul (point[3], point[1], point[2]) == 0);
    }

    boolean isSquare(Point[] point) {

        return isRectangle(point) && abs(point[3].dist(point[1]) - point[1].dist(point[0])) < EPS;
    }

    Point[] point = new Point[8];

    int[] squareIndex = new int[4];
    int[] rectangleIndex = new int[4];

    Point[] square = new Point[4];
    Point[] rectangle = new Point[4];

    boolean[] used = new boolean[8];
    boolean dfs (int p) {
        if(p == 4) {
            int k = 0;
            for(int i = 0; i < 8; i++) {
                boolean existIndex = false;
                for(int j = 0; j < 4; j++) {
                    if(i == squareIndex[j])
                        existIndex = true;
                }
                if(!existIndex) {
                    rectangleIndex[k++] = i;
                }
            }

            for(int i = 0; i < 4; i++)
                square[i] = point[squareIndex[i]];
            for(int i = 0; i < 4; i++)
                rectangle[i] = point[rectangleIndex[i]];

//          System.err.println("Sq: " + Arrays.toString(squareIndex) + " " + isSquare(square));
//          System.err.println("Re: " + Arrays.toString(rectangleIndex) + " " + isRectangle(rectangle));

            if(isRectangle(rectangle) && isSquare(square))
                return true;
        } else {
            for(int i = 0; i < 8; i++) {
                if(!used[i]) {
                    used[i] = true;
                    squareIndex[p] = i;
                    if ( dfs( p + 1 ) )
                        return true;
                    used[i] = false;
                }
            }
        }
        return false;
    }

    private void solve() throws IOException {
        for(int i = 0; i < 8; i++) {
            point[i] = new Point(nextInt(), nextInt());
        }

//      Point[] p = new Point[4];
//      for(int i = 0; i < 4; i++)
//          p[i] = point[i];
//      sort(p);
//      for(int i = 0; i < 4; i++) {
//          out.println(p[i].x + " " + p[i].y);
//      }
//      System.err.println(isSquare(p));

        if(dfs(0)) {
            out.println("YES");
            for(int i = 0; i < 4; i++)
                out.print((squareIndex[i] + 1) + " ");
            out.println();
            for(int i = 0; i < 4; i++)
                out.print((rectangleIndex[i] + 1) + " ");
            out.println();
        } else {
            out.println("NO");
        }
    }

    String nextToken() throws IOException {
        while (!st.hasMoreTokens())
            st = new StringTokenizer(in.readLine());
        return st.nextToken();
    }
    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
    String nextLine() throws IOException {
        st = new StringTokenizer("");
        return in.readLine();
    }
    boolean EOF() throws IOException {
        while (!st.hasMoreTokens()) {
            String s = in.readLine();
            if (s == null)
                return true;
            st = new StringTokenizer(s);
        }
        return false;
    }
}


import java.io.*;
import java.util.*;
import java.util.Random;
import java.util.StringTokenizer;

public class Main {

    long b = 31;
    String fileName = "";

    //////////////////////    SOLUTION   SOLUTION  SOLUTION    //////////////////////////////
    int INF = Integer.MAX_VALUE / 10;
    long MODULO = 1000*1000*1000+7;

    void solve() throws IOException {
        int n = 8;
        Point[] points = new Point[n];
        for (int i=0; i<n; ++i)
            points[i] = new Point(readInt(), readInt());
        Point[] points1 = new Point[4];
        Point[] points2 = new Point[4];

        for (int mask=0; mask < 1<<n; ++mask){
            if (Integer.bitCount(mask) == 4){
                int cur1 = 0;
                int cur2 = 0;
                for (int bit=0; bit<n; ++bit){
                    if (checkBit(mask, bit) == 1) points1[cur1++] = points[bit];
                    else points2[cur2++] = points[bit];
                }
                boolean isSquare = checkSquare(points1[0], points1[1], points1[2], points1[3])
                        || checkSquare(points1[0], points1[2], points1[1], points1[3]) ||  checkSquare(points1[0], points1[1], points1[3], points1[2])
                        || checkSquare(points1[0], points1[2], points1[3], points1[1]) || checkSquare(points1[0], points1[3], points1[1], points1[2])
                        || checkSquare(points1[0], points1[3], points1[2], points1[1]);
                boolean isRecktangle = checkRecktangle(points2[0], points2[1], points2[2], points2[3]) || checkRecktangle(points2[0], points2[2], points2[1], points2[3])
                        || checkRecktangle(points2[0], points2[1], points2[3], points2[2]) || checkRecktangle(points2[0], points2[2], points2[3], points2[1]);
                //out.println(isRecktangle +" " + isSquare);
                if (isSquare && isRecktangle){
                    out.println("YES");
                    for (int bit=0; bit<n; ++bit)
                        if (checkBit(mask, bit) == 1) out.print(bit+1+" ");
                    out.println();
                    for (int bit=0; bit<n; ++bit)
                        if (checkBit(mask, bit) == 0) out.print(bit+1+" ");
                    return;
                }
            }
        }
        out.println("NO");
    }
    boolean checkRecktangle(Point p1, Point p2, Point p3, Point p4){
        int len1 = (p1.x - p2.x)*(p1.x - p2.x) + (p1.y - p2.y)*(p1.y - p2.y);
        int len2 = (p3.x - p4.x)*(p3.x - p4.x) + (p3.y - p4.y)*(p3.y - p4.y);

        int v1X = p2.x - p1.x;
        int v1Y = p2.y - p1.y;

        int v2X = p4.x - p3.x;
        int v2Y = p4.y - p3.y;

        int v3X = p4.x - p1.x;
        int v3Y = p4.y - p1.y;

        int mul1 = v1X*v2Y - v1Y*v2X;
        int mul2 = v3X*v2X + v3Y*v2Y;
        return len1 == len2 && mul1 == 0 && mul2 == 0;
    }
    boolean checkSquare(Point p1, Point p2, Point p3, Point p4){
        int len1 = (p1.x - p2.x)*(p1.x - p2.x) + (p1.y - p2.y)*(p1.y - p2.y);
        int len2 = (p3.x - p4.x)*(p3.x - p4.x) + (p3.y - p4.y)*(p3.y - p4.y);
        int len3 = (p4.x - p1.x)*(p4.x - p1.x) + (p4.y - p1.y)*(p4.y - p1.y);
        int len4 = (p2.x - p3.x)*(p2.x - p3.x) + (p2.y - p3.y)*(p2.y - p3.y);

        int v1X = p2.x - p1.x;
        int v1Y = p2.y - p1.y;

        int v2X = p4.x - p3.x;
        int v2Y = p4.y - p3.y;

        int v3X = p4.x - p1.x;
        int v3Y = p4.y - p1.y;

        int mul1 = v1X*v2Y - v1Y*v2X;
        int mul2 = v3X*v2X + v3Y*v2Y;
        //out.println(len1 +" "+len2 +" "+ len3 +" "+ len4 +" " + mul1 +" " + mul2);
        return len1 == len2 && len1 == len3 && len1 == len4 && mul1 == 0 && mul2 == 0;
    }

    class Move{
        int car, x, y;
        Move(int car, int x, int y){
            this.x = x;
            this.y = y;
            this.car = car;
        }
    }
    class Point{
        int x, y;
        Point(int x, int y){
            this.x = x;
            this.y = y;
        }
    }

    class Vertex implements Comparable<Vertex>{
        int dist, from;
        Vertex(int b, int c){
            this.dist = c;
            this.from = b;
        }

        @Override
        public int compareTo(Vertex o) {
            return this.dist-o.dist;
        }
    }
    ///////////////////////////////////////////////////////////////////////////////////////////

    class Edge{
        int from, to, dist;
        Edge(int from, int to, int dist){
            this.from = from;
            this.to = to;
            this.dist = dist;
        }
    }

    void readUndirectedGraph (int n, int m, int[][] graph) throws IOException{
        Edge[] edges = new Edge[n-1];
        int[] countEdges = new int[n];
        graph = new int[n][];
        for (int i=0; i<n-1; ++i){
            int from = readInt() - 1;
            int to = readInt() - 1;
            countEdges[from]++;
            countEdges[to]++;
            edges[i] = new Edge(from, to, 0);
        }
        for (int i=0; i<n; ++i) graph[i] = new int[countEdges[i]];
        for (int i=0; i<n-1; ++i){
            graph[edges[i].to][--countEdges[edges[i].to]] = edges[i].dist;
            graph[edges[i].dist][-- countEdges[edges[i].dist]] = edges[i].to;
        }
    }
    class SparseTable{
        int[][] rmq;
        int[] logTable;
        int n;
        SparseTable(int[] a){
            n = a.length;
            logTable = new int[n+1];
            for(int i = 2; i <= n; ++i){
                logTable[i] = logTable[i >> 1] + 1;
            }
            rmq = new int[logTable[n] + 1][n];
            for(int i=0; i<n; ++i){
                rmq[0][i] = a[i];
            }

            for(int k=1; (1 << k) < n; ++k){
                for(int i=0; i + (1 << k) <= n; ++i){
                    int max1 = rmq[k - 1][i];
                    int max2 = rmq[k-1][i + (1 << (k-1))];
                    rmq[k][i] = Math.max(max1, max2);
                }
            }
        }

        int max(int l, int r){
            int k = logTable[r - l];
            int max1 = rmq[k][l];
            int max2 = rmq[k][r - (1 << k) + 1];
            return Math.max(max1, max2);
        }
    }
    long checkBit(long mask, int bit){
        return (mask >> bit) & 1;
    }
    class Dsu{
        int[] parent;
        int countSets;
        Dsu(int n){
            countSets = n;
            parent = new int[n];
            for(int i=0; i<n; ++i){
                parent[i] = i;
            }
        }
        int findSet(int a){
            if(parent[a] == a) return a;
            parent[a] = findSet(parent[a]);
            return parent[a];
        }
        void unionSets(int a, int b){
            a = findSet(a);
            b = findSet(b);
            if(a!=b){
                countSets--;
                parent[a] = b;
            }
        }
    }
    static int checkBit(int mask, int bit) {
        return (mask >> bit) & 1;
    }
    boolean isLower(char c){
        return c >= 'a' && c <= 'z';
    }

    ////////////////////////////////////////////////////////////

    class SegmentTree{
        int[] t;
        int n;
        SegmentTree(int n){
            t = new int[4*n];
            build(new int[n+1], 1, 1, n);
        }
        void build (int a[], int v, int tl, int tr) {
            if (tl == tr)
                t[v] = a[tl];
            else {
                int tm = (tl + tr) / 2;
                build (a, v*2, tl, tm);
                build (a, v*2+1, tm+1, tr);
            }
        }

        void update (int v, int tl, int tr, int l, int r, int add) {
            if (l > r)
                return;
            if (l == tl && tr == r)
                t[v] += add;
            else {
                int tm = (tl + tr) / 2;
                update (v*2, tl, tm, l, Math.min(r,tm), add);
                update (v*2+1, tm+1, tr, Math.max(l,tm+1), r, add);
            }
        }

        int get (int v, int tl, int tr, int pos) {
            if (tl == tr)
                return t[v];
            int tm = (tl + tr) / 2;
            if (pos <= tm)
                return t[v] + get (v*2, tl, tm, pos);
            else
                return t[v] + get (v*2+1, tm+1, tr, pos);
        }
    }
    class Fenwik {
        long[] t;
        int length;

        Fenwik(int[] a) {
            length = a.length + 100;
            t = new long[length];

            for (int i = 0; i < a.length; ++i) {
                inc(i, a[i]);
            }
        }

        void inc(int ind, int delta) {
            for (; ind < length; ind = ind | (ind + 1)) {
                t[ind] = Math.max(delta, t[ind]);
            }
        }

        long getMax(int r) {
            long sum = 0;
            for (; r >= 0; r = (r & (r + 1)) - 1) {
                sum = Math.max(sum, t[r]);
            }
            return sum;
        }
    }
    int gcd(int a, int b){
        return b == 0 ? a : gcd(b, a%b);
    }
    long gcd(long a, long b){
        return b == 0 ? a : gcd(b, a%b);
    }
    long binPow(long a, long b, long m) {
        if (b == 0) {
            return 1;
        }
        if (b % 2 == 1) {
            return ((a % m) * (binPow(a, b - 1, m) % m)) % m;
        } else {
            long c = binPow(a, b / 2, m);
            return (c * c) % m;
        }

    }
    int minInt(int... values) {
        int min = Integer.MAX_VALUE;
        for (int value : values) min = Math.min(min, value);
        return min;
    }

    int maxInt(int... values) {
        int max = Integer.MIN_VALUE;
        for (int value : values) max = Math.max(max, value);
        return max;
    }
    public static void main(String[] args) throws NumberFormatException, IOException {
        // TODO Auto-generated method stub
        new Main().run();
    }

    void run() throws NumberFormatException, IOException {
        solve();
        out.close();
    };

    BufferedReader in;
    PrintWriter out;

    StringTokenizer tok;
    String delim = " ";
    Random rnd = new Random();

    Main() throws FileNotFoundException {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        } catch (Exception e) {
            if (fileName.isEmpty()) {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                in = new BufferedReader(new FileReader(fileName + ".in"));
                out = new PrintWriter(fileName + ".out");
            }

        }
        tok = new StringTokenizer("");
    }

    String readLine() throws IOException {
        return in.readLine();
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            String nextLine = readLine();
            if (null == nextLine) {
                return null;
            }

            tok = new StringTokenizer(nextLine);
        }
        return tok.nextToken();
    }

    int readInt() throws NumberFormatException, IOException {
        return Integer.parseInt(readString());
    }
    byte readByte() throws NumberFormatException, IOException {
        return Byte.parseByte(readString());
    }
    int[] readIntArray (int n) throws NumberFormatException, IOException {
        int[] a = new int[n];
        for(int i=0; i<n; ++i){
            a[i] = readInt();
        }
        return a;
    }

    Integer[] readIntegerArray (int n) throws NumberFormatException, IOException {
        Integer[] a = new Integer[n];
        for(int i=0; i<n; ++i){
            a[i] = readInt();
        }
        return a;
    }

    long readLong() throws NumberFormatException, IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(readString());
    }
}


import java.io.*;
import java.util.*;
import java.util.Random;
import java.util.StringTokenizer;

public class Main {

    long b = 31;
    String fileName = "";

    //////////////////////    SOLUTION   SOLUTION  SOLUTION    //////////////////////////////
    int INF = Integer.MAX_VALUE / 10;
    long MODULO = 1000*1000*1000+7;

    void solve() throws IOException {
        int n = 8;
        Point[] points = new Point[n];
        for (int i=0; i<n; ++i)
            points[i] = new Point(readInt(), readInt());
        Point[] points1 = new Point[4];
        Point[] points2 = new Point[4];

        for (int mask=0; mask < 1<<n; ++mask){
            if (Integer.bitCount(mask) == 4){
                int cur1 = 0;
                int cur2 = 0;
                for (int bit=0; bit<n; ++bit){
                    if (checkBit(mask, bit) == 1) points1[cur1++] = points[bit];
                    else points2[cur2++] = points[bit];
                }
                boolean isSquare = checkSquare(points1[0], points1[1], points1[2], points1[3])
                        || checkSquare(points1[0], points1[2], points1[1], points1[3]) ||  checkSquare(points1[0], points1[1], points1[3], points1[2])
                        || checkSquare(points1[0], points1[2], points1[3], points1[1]) || checkSquare(points1[0], points1[3], points1[1], points1[2])
                        || checkSquare(points1[0], points1[3], points1[2], points1[1]);
                boolean isRecktangle = checkRecktangle(points2[0], points2[1], points2[2], points2[3]) || checkRecktangle(points2[0], points2[2], points2[1], points2[3])
                        || checkRecktangle(points2[0], points2[1], points2[3], points2[2]) || checkRecktangle(points2[0], points2[2], points2[3], points2[1]);
                //out.println(isRecktangle +" " + isSquare);
                if (isSquare && isRecktangle){
                    out.println("YES");
                    for (int bit=0; bit<n; ++bit)
                        if (checkBit(mask, bit) == 0) out.print(bit+1+" ");
                    out.println();
                    for (int bit=0; bit<n; ++bit)
                        if (checkBit(mask, bit) == 1) out.print(bit+1+" ");
                    return;
                }
            }
        }
        out.println("NO");
    }
    boolean checkRecktangle(Point p1, Point p2, Point p3, Point p4){
        int len1 = (p1.x - p2.x)*(p1.x - p2.x) + (p1.y - p2.y)*(p1.y - p2.y);
        int len2 = (p3.x - p4.x)*(p3.x - p4.x) + (p3.y - p4.y)*(p3.y - p4.y);

        int v1X = p2.x - p1.x;
        int v1Y = p2.y - p1.y;

        int v2X = p4.x - p3.x;
        int v2Y = p4.y - p3.y;

        int v3X = p4.x - p1.x;
        int v3Y = p4.y - p1.y;

        int mul1 = v1X*v2Y - v1Y*v2X;
        int mul2 = v3X*v2X + v3Y*v2Y;
        return len1 == len2 && mul1 == 0 && mul2 == 0;
    }
    boolean checkSquare(Point p1, Point p2, Point p3, Point p4){
        int len1 = (p1.x - p2.x)*(p1.x - p2.x) + (p1.y - p2.y)*(p1.y - p2.y);
        int len2 = (p3.x - p4.x)*(p3.x - p4.x) + (p3.y - p4.y)*(p3.y - p4.y);
        int len3 = (p4.x - p1.x)*(p4.x - p1.x) + (p4.y - p1.y)*(p4.y - p1.y);
        int len4 = (p2.x - p3.x)*(p2.x - p3.x) + (p2.y - p3.y)*(p2.y - p3.y);

        int v1X = p2.x - p1.x;
        int v1Y = p2.y - p1.y;

        int v2X = p4.x - p3.x;
        int v2Y = p4.y - p3.y;

        int v3X = p4.x - p1.x;
        int v3Y = p4.y - p1.y;

        int mul1 = v1X*v2Y - v1Y*v2X;
        int mul2 = v3X*v2X + v3Y*v2Y;
        //out.println(len1 +" "+len2 +" "+ len3 +" "+ len4 +" " + mul1 +" " + mul2);
        return len1 == len2 && len1 == len3 && len1 == len4 && mul1 == 0 && mul2 == 0;
    }

    class Move{
        int car, x, y;
        Move(int car, int x, int y){
            this.x = x;
            this.y = y;
            this.car = car;
        }
    }
    class Point{
        int x, y;
        Point(int x, int y){
            this.x = x;
            this.y = y;
        }
    }

    class Vertex implements Comparable<Vertex>{
        int dist, from;
        Vertex(int b, int c){
            this.dist = c;
            this.from = b;
        }

        @Override
        public int compareTo(Vertex o) {
            return this.dist-o.dist;
        }
    }
    ///////////////////////////////////////////////////////////////////////////////////////////

    class Edge{
        int from, to, dist;
        Edge(int from, int to, int dist){
            this.from = from;
            this.to = to;
            this.dist = dist;
        }
    }

    void readUndirectedGraph (int n, int m, int[][] graph) throws IOException{
        Edge[] edges = new Edge[n-1];
        int[] countEdges = new int[n];
        graph = new int[n][];
        for (int i=0; i<n-1; ++i){
            int from = readInt() - 1;
            int to = readInt() - 1;
            countEdges[from]++;
            countEdges[to]++;
            edges[i] = new Edge(from, to, 0);
        }
        for (int i=0; i<n; ++i) graph[i] = new int[countEdges[i]];
        for (int i=0; i<n-1; ++i){
            graph[edges[i].to][--countEdges[edges[i].to]] = edges[i].dist;
            graph[edges[i].dist][-- countEdges[edges[i].dist]] = edges[i].to;
        }
    }
    class SparseTable{
        int[][] rmq;
        int[] logTable;
        int n;
        SparseTable(int[] a){
            n = a.length;
            logTable = new int[n+1];
            for(int i = 2; i <= n; ++i){
                logTable[i] = logTable[i >> 1] + 1;
            }
            rmq = new int[logTable[n] + 1][n];
            for(int i=0; i<n; ++i){
                rmq[0][i] = a[i];
            }

            for(int k=1; (1 << k) < n; ++k){
                for(int i=0; i + (1 << k) <= n; ++i){
                    int max1 = rmq[k - 1][i];
                    int max2 = rmq[k-1][i + (1 << (k-1))];
                    rmq[k][i] = Math.max(max1, max2);
                }
            }
        }

        int max(int l, int r){
            int k = logTable[r - l];
            int max1 = rmq[k][l];
            int max2 = rmq[k][r - (1 << k) + 1];
            return Math.max(max1, max2);
        }
    }
    long checkBit(long mask, int bit){
        return (mask >> bit) & 1;
    }
    class Dsu{
        int[] parent;
        int countSets;
        Dsu(int n){
            countSets = n;
            parent = new int[n];
            for(int i=0; i<n; ++i){
                parent[i] = i;
            }
        }
        int findSet(int a){
            if(parent[a] == a) return a;
            parent[a] = findSet(parent[a]);
            return parent[a];
        }
        void unionSets(int a, int b){
            a = findSet(a);
            b = findSet(b);
            if(a!=b){
                countSets--;
                parent[a] = b;
            }
        }
    }
    static int checkBit(int mask, int bit) {
        return (mask >> bit) & 1;
    }
    boolean isLower(char c){
        return c >= 'a' && c <= 'z';
    }

    ////////////////////////////////////////////////////////////

    class SegmentTree{
        int[] t;
        int n;
        SegmentTree(int n){
            t = new int[4*n];
            build(new int[n+1], 1, 1, n);
        }
        void build (int a[], int v, int tl, int tr) {
            if (tl == tr)
                t[v] = a[tl];
            else {
                int tm = (tl + tr) / 2;
                build (a, v*2, tl, tm);
                build (a, v*2+1, tm+1, tr);
            }
        }

        void update (int v, int tl, int tr, int l, int r, int add) {
            if (l > r)
                return;
            if (l == tl && tr == r)
                t[v] += add;
            else {
                int tm = (tl + tr) / 2;
                update (v*2, tl, tm, l, Math.min(r,tm), add);
                update (v*2+1, tm+1, tr, Math.max(l,tm+1), r, add);
            }
        }

        int get (int v, int tl, int tr, int pos) {
            if (tl == tr)
                return t[v];
            int tm = (tl + tr) / 2;
            if (pos <= tm)
                return t[v] + get (v*2, tl, tm, pos);
            else
                return t[v] + get (v*2+1, tm+1, tr, pos);
        }
    }
    class Fenwik {
        long[] t;
        int length;

        Fenwik(int[] a) {
            length = a.length + 100;
            t = new long[length];

            for (int i = 0; i < a.length; ++i) {
                inc(i, a[i]);
            }
        }

        void inc(int ind, int delta) {
            for (; ind < length; ind = ind | (ind + 1)) {
                t[ind] = Math.max(delta, t[ind]);
            }
        }

        long getMax(int r) {
            long sum = 0;
            for (; r >= 0; r = (r & (r + 1)) - 1) {
                sum = Math.max(sum, t[r]);
            }
            return sum;
        }
    }
    int gcd(int a, int b){
        return b == 0 ? a : gcd(b, a%b);
    }
    long gcd(long a, long b){
        return b == 0 ? a : gcd(b, a%b);
    }
    long binPow(long a, long b, long m) {
        if (b == 0) {
            return 1;
        }
        if (b % 2 == 1) {
            return ((a % m) * (binPow(a, b - 1, m) % m)) % m;
        } else {
            long c = binPow(a, b / 2, m);
            return (c * c) % m;
        }

    }
    int minInt(int... values) {
        int min = Integer.MAX_VALUE;
        for (int value : values) min = Math.min(min, value);
        return min;
    }

    int maxInt(int... values) {
        int max = Integer.MIN_VALUE;
        for (int value : values) max = Math.max(max, value);
        return max;
    }
    public static void main(String[] args) throws NumberFormatException, IOException {
        // TODO Auto-generated method stub
        new Main().run();
    }

    void run() throws NumberFormatException, IOException {
        solve();
        out.close();
    };

    BufferedReader in;
    PrintWriter out;

    StringTokenizer tok;
    String delim = " ";
    Random rnd = new Random();

    Main() throws FileNotFoundException {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        } catch (Exception e) {
            if (fileName.isEmpty()) {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                in = new BufferedReader(new FileReader(fileName + ".in"));
                out = new PrintWriter(fileName + ".out");
            }

        }
        tok = new StringTokenizer("");
    }

    String readLine() throws IOException {
        return in.readLine();
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            String nextLine = readLine();
            if (null == nextLine) {
                return null;
            }

            tok = new StringTokenizer(nextLine);
        }
        return tok.nextToken();
    }

    int readInt() throws NumberFormatException, IOException {
        return Integer.parseInt(readString());
    }
    byte readByte() throws NumberFormatException, IOException {
        return Byte.parseByte(readString());
    }
    int[] readIntArray (int n) throws NumberFormatException, IOException {
        int[] a = new int[n];
        for(int i=0; i<n; ++i){
            a[i] = readInt();
        }
        return a;
    }

    Integer[] readIntegerArray (int n) throws NumberFormatException, IOException {
        Integer[] a = new Integer[n];
        for(int i=0; i<n; ++i){
            a[i] = readInt();
        }
        return a;
    }

    long readLong() throws NumberFormatException, IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(readString());
    }
}


import java.io.*;
import java.util.*;
import java.util.Random;
import java.util.StringTokenizer;

public class Main {

    long b = 31;
    String fileName = "";

    //////////////////////    SOLUTION   SOLUTION  SOLUTION    //////////////////////////////
    int INF = Integer.MAX_VALUE / 10;
    long MODULO = 1000*1000*1000+7;

    void solve() throws IOException {
        int n = 8;
        Point[] points = new Point[n];
        for (int i=0; i<n; ++i)
            points[i] = new Point(readInt(), readInt());
        Point[] points1 = new Point[4];
        Point[] points2 = new Point[4];

        for (int mask=0; mask < 1<<n; ++mask){
            if (Integer.bitCount(mask) == 4){
                int cur1 = 0;
                int cur2 = 0;
                for (int bit=0; bit<n; ++bit){
                    if (checkBit(mask, bit) == 1) points1[cur1++] = points[bit];
                    else points2[cur2++] = points[bit];
                }
                boolean isSquare = checkSquare(points1[0], points1[1], points1[2], points1[3])
                        || checkSquare(points1[0], points1[2], points1[1], points1[3]) ||  checkSquare(points1[0], points1[1], points1[3], points1[2])
                        || checkSquare(points1[0], points1[2], points1[3], points1[1]) || checkSquare(points1[0], points1[3], points1[1], points1[2])
                        || checkSquare(points1[0], points1[3], points1[2], points1[1]);
                boolean isRecktangle = checkRecktangle(points2[0], points2[1], points2[2], points2[3]) || checkRecktangle(points2[0], points2[2], points2[1], points2[3])
                        || checkRecktangle(points2[0], points2[1], points2[3], points2[2]) || checkRecktangle(points2[0], points2[2], points2[3], points2[1])
                        || checkRecktangle(points2[0], points2[3], points2[2], points2[1]) || checkRecktangle(points2[0], points2[3], points2[1], points2[2]);
               // out.println(isRecktangle +" " + isSquare);
                if (isSquare && isRecktangle){
                    out.println("YES");
                    for (int bit=0; bit<n; ++bit)
                        if (checkBit(mask, bit) == 1) out.print(bit+1+" ");
                    out.println();
                    for (int bit=0; bit<n; ++bit)
                        if (checkBit(mask, bit) == 0) out.print(bit+1+" ");
                    return;
                }
            }
        }
        out.println("NO");
    }
    boolean checkRecktangle(Point p1, Point p2, Point p3, Point p4){
        int len1 = (p1.x - p2.x)*(p1.x - p2.x) + (p1.y - p2.y)*(p1.y - p2.y);
        int len2 = (p3.x - p4.x)*(p3.x - p4.x) + (p3.y - p4.y)*(p3.y - p4.y);

        int v1X = p2.x - p1.x;
        int v1Y = p2.y - p1.y;

        int v2X = p4.x - p3.x;
        int v2Y = p4.y - p3.y;

        int v3X = p4.x - p1.x;
        int v3Y = p4.y - p1.y;

        int v4X = p3.x - p2.x;
        int v4Y = p3.y - p2.y;

        int mul1 = v1X*v2Y - v1Y*v2X;
        int mul2 = v3X*v2X + v3Y*v2Y;
        int mul3 = v4X*v2X + v4Y*v2Y;
        return len1 == len2 && mul1 == 0 && mul2 == 0 && mul3 == 0;
    }
    boolean checkSquare(Point p1, Point p2, Point p3, Point p4){
        int len1 = (p1.x - p2.x)*(p1.x - p2.x) + (p1.y - p2.y)*(p1.y - p2.y);
        int len2 = (p3.x - p4.x)*(p3.x - p4.x) + (p3.y - p4.y)*(p3.y - p4.y);
        int len3 = (p4.x - p1.x)*(p4.x - p1.x) + (p4.y - p1.y)*(p4.y - p1.y);
        int len4 = (p2.x - p3.x)*(p2.x - p3.x) + (p2.y - p3.y)*(p2.y - p3.y);

        int v1X = p2.x - p1.x;
        int v1Y = p2.y - p1.y;

        int v2X = p4.x - p3.x;
        int v2Y = p4.y - p3.y;

        int v3X = p4.x - p1.x;
        int v3Y = p4.y - p1.y;

        int mul1 = v1X*v2Y - v1Y*v2X;
        int mul2 = v3X*v2X + v3Y*v2Y;
      //  out.println(len1 +" "+len2 +" "+ len3 +" "+ len4 +" " + mul1 +" " + mul2);
        return len1 == len2 && len1 == len3 && len1 == len4 && mul1 == 0 && mul2 == 0;
    }

    class Move{
        int car, x, y;
        Move(int car, int x, int y){
            this.x = x;
            this.y = y;
            this.car = car;
        }
    }
    class Point{
        int x, y;
        Point(int x, int y){
            this.x = x;
            this.y = y;
        }
    }

    class Vertex implements Comparable<Vertex>{
        int dist, from;
        Vertex(int b, int c){
            this.dist = c;
            this.from = b;
        }

        @Override
        public int compareTo(Vertex o) {
            return this.dist-o.dist;
        }
    }
    ///////////////////////////////////////////////////////////////////////////////////////////

    class Edge{
        int from, to, dist;
        Edge(int from, int to, int dist){
            this.from = from;
            this.to = to;
            this.dist = dist;
        }
    }

    void readUndirectedGraph (int n, int m, int[][] graph) throws IOException{
        Edge[] edges = new Edge[n-1];
        int[] countEdges = new int[n];
        graph = new int[n][];
        for (int i=0; i<n-1; ++i){
            int from = readInt() - 1;
            int to = readInt() - 1;
            countEdges[from]++;
            countEdges[to]++;
            edges[i] = new Edge(from, to, 0);
        }
        for (int i=0; i<n; ++i) graph[i] = new int[countEdges[i]];
        for (int i=0; i<n-1; ++i){
            graph[edges[i].to][--countEdges[edges[i].to]] = edges[i].dist;
            graph[edges[i].dist][-- countEdges[edges[i].dist]] = edges[i].to;
        }
    }
    class SparseTable{
        int[][] rmq;
        int[] logTable;
        int n;
        SparseTable(int[] a){
            n = a.length;
            logTable = new int[n+1];
            for(int i = 2; i <= n; ++i){
                logTable[i] = logTable[i >> 1] + 1;
            }
            rmq = new int[logTable[n] + 1][n];
            for(int i=0; i<n; ++i){
                rmq[0][i] = a[i];
            }

            for(int k=1; (1 << k) < n; ++k){
                for(int i=0; i + (1 << k) <= n; ++i){
                    int max1 = rmq[k - 1][i];
                    int max2 = rmq[k-1][i + (1 << (k-1))];
                    rmq[k][i] = Math.max(max1, max2);
                }
            }
        }

        int max(int l, int r){
            int k = logTable[r - l];
            int max1 = rmq[k][l];
            int max2 = rmq[k][r - (1 << k) + 1];
            return Math.max(max1, max2);
        }
    }
    long checkBit(long mask, int bit){
        return (mask >> bit) & 1;
    }
    class Dsu{
        int[] parent;
        int countSets;
        Dsu(int n){
            countSets = n;
            parent = new int[n];
            for(int i=0; i<n; ++i){
                parent[i] = i;
            }
        }
        int findSet(int a){
            if(parent[a] == a) return a;
            parent[a] = findSet(parent[a]);
            return parent[a];
        }
        void unionSets(int a, int b){
            a = findSet(a);
            b = findSet(b);
            if(a!=b){
                countSets--;
                parent[a] = b;
            }
        }
    }
    static int checkBit(int mask, int bit) {
        return (mask >> bit) & 1;
    }
    boolean isLower(char c){
        return c >= 'a' && c <= 'z';
    }

    ////////////////////////////////////////////////////////////

    class SegmentTree{
        int[] t;
        int n;
        SegmentTree(int n){
            t = new int[4*n];
            build(new int[n+1], 1, 1, n);
        }
        void build (int a[], int v, int tl, int tr) {
            if (tl == tr)
                t[v] = a[tl];
            else {
                int tm = (tl + tr) / 2;
                build (a, v*2, tl, tm);
                build (a, v*2+1, tm+1, tr);
            }
        }

        void update (int v, int tl, int tr, int l, int r, int add) {
            if (l > r)
                return;
            if (l == tl && tr == r)
                t[v] += add;
            else {
                int tm = (tl + tr) / 2;
                update (v*2, tl, tm, l, Math.min(r,tm), add);
                update (v*2+1, tm+1, tr, Math.max(l,tm+1), r, add);
            }
        }

        int get (int v, int tl, int tr, int pos) {
            if (tl == tr)
                return t[v];
            int tm = (tl + tr) / 2;
            if (pos <= tm)
                return t[v] + get (v*2, tl, tm, pos);
            else
                return t[v] + get (v*2+1, tm+1, tr, pos);
        }
    }
    class Fenwik {
        long[] t;
        int length;

        Fenwik(int[] a) {
            length = a.length + 100;
            t = new long[length];

            for (int i = 0; i < a.length; ++i) {
                inc(i, a[i]);
            }
        }

        void inc(int ind, int delta) {
            for (; ind < length; ind = ind | (ind + 1)) {
                t[ind] = Math.max(delta, t[ind]);
            }
        }

        long getMax(int r) {
            long sum = 0;
            for (; r >= 0; r = (r & (r + 1)) - 1) {
                sum = Math.max(sum, t[r]);
            }
            return sum;
        }
    }
    int gcd(int a, int b){
        return b == 0 ? a : gcd(b, a%b);
    }
    long gcd(long a, long b){
        return b == 0 ? a : gcd(b, a%b);
    }
    long binPow(long a, long b, long m) {
        if (b == 0) {
            return 1;
        }
        if (b % 2 == 1) {
            return ((a % m) * (binPow(a, b - 1, m) % m)) % m;
        } else {
            long c = binPow(a, b / 2, m);
            return (c * c) % m;
        }

    }
    int minInt(int... values) {
        int min = Integer.MAX_VALUE;
        for (int value : values) min = Math.min(min, value);
        return min;
    }

    int maxInt(int... values) {
        int max = Integer.MIN_VALUE;
        for (int value : values) max = Math.max(max, value);
        return max;
    }
    public static void main(String[] args) throws NumberFormatException, IOException {
        // TODO Auto-generated method stub
        new Main().run();
    }

    void run() throws NumberFormatException, IOException {
        solve();
        out.close();
    };

    BufferedReader in;
    PrintWriter out;

    StringTokenizer tok;
    String delim = " ";
    Random rnd = new Random();

    Main() throws FileNotFoundException {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        } catch (Exception e) {
            if (fileName.isEmpty()) {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                in = new BufferedReader(new FileReader(fileName + ".in"));
                out = new PrintWriter(fileName + ".out");
            }

        }
        tok = new StringTokenizer("");
    }

    String readLine() throws IOException {
        return in.readLine();
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            String nextLine = readLine();
            if (null == nextLine) {
                return null;
            }

            tok = new StringTokenizer(nextLine);
        }
        return tok.nextToken();
    }

    int readInt() throws NumberFormatException, IOException {
        return Integer.parseInt(readString());
    }
    byte readByte() throws NumberFormatException, IOException {
        return Byte.parseByte(readString());
    }
    int[] readIntArray (int n) throws NumberFormatException, IOException {
        int[] a = new int[n];
        for(int i=0; i<n; ++i){
            a[i] = readInt();
        }
        return a;
    }

    Integer[] readIntegerArray (int n) throws NumberFormatException, IOException {
        Integer[] a = new Integer[n];
        for(int i=0; i<n; ++i){
            a[i] = readInt();
        }
        return a;
    }

    long readLong() throws NumberFormatException, IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(readString());
    }
}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class RectSquare{

	int[] x, y;

	public static void main(String[] args)
	{
		new RectSquare().run();
	}

	public void run()
	{
		Scanner file = new Scanner(System.in);
		x = new int[8];
		y = new int[8];
		for(int i = 0;i<8;i++)
		{
			x[i] = file.nextInt();
			y[i] = file.nextInt();
		}
		for(int i = 0;i<8;i++)
		{
			for(int j = 0;j<8;j++)
			{
				if(i == j)
					continue;
				for(int k = 0;k<8;k++)
				{
					if(i == k || j == k)
						continue;
					for(int l = 0;l<8;l++)
					{
						if(i == l || j == l || k == l)
							continue;
						for(int m = 0;m<8;m++)
						{
							if(i == m || j == m || k == m || l == m)
								continue;
							for(int n = 0;n<8;n++)
							{
								if(i == n || j == n || k ==n || l == n || m == n)
									continue;
								for(int o = 0;o<8;o++)
								{
									if(i == o || j ==  o || k == o || l == o || m == o || n == o)
										continue;
									for(int p = 0;p<8;p++)
									{
										if(i == p || j == p || k == p || l == p || m == p || n == p || o == p)
											continue;
										int squaretl = i;
										int squaretr = j;
										int squarebl = k;
										int squarebr = l;
										int recttl = m;
										int recttr = n;
										int rectbl = o;
										int rectbr = p;
										double sideLen = dist(squaretl, squaretr);
										double root2 = Math.sqrt(2.0);
										boolean square = close(dist(squaretl,squaretr),sideLen) &&
												close(dist(squaretl,squarebl),sideLen) &&
												close(dist(squaretl,squarebr),sideLen*root2) &&
												close(dist(squaretr,squarebr),sideLen) &&
												close(dist(squaretr,squarebl),sideLen*root2) &&
												close(dist(squarebl,squarebr),sideLen);
										double horzSide = dist(recttl, recttr);
										double vertSide = dist(recttl, rectbl);
										double diag = Math.hypot(horzSide, vertSide);
										boolean rect = close(dist(rectbl, rectbr), horzSide)
												&& close(dist(recttr, rectbr), vertSide)
												&& close(dist(recttl, rectbr), diag)
												&& close(dist(recttr, rectbl), diag)
												&& horzSide * vertSide != 0;
										if(square && rect)
										{
											System.out.println("YES");
											System.out.printf("%d %d %d %d%n", i+1, j+1, k+1, l+1);
											System.out.printf("%d %d %d %d%n", m+1, n+1, o+1, p+1);
											return;
										}
									}
								}
							}
						}
					}
				}
			}
		}
		System.out.println("NO");
	}

	boolean close(double x, double y)
	{
		return Math.abs(x-y) < .00000001;
	}

	double dist(int i, int j)
	{
		return Math.hypot(Math.abs(x[i]-x[j]), Math.abs(y[i] - y[j]));
	}
}


import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
	//static final long MOD = 998244353;
	static final long MOD = 1000000007;
	static boolean[] visited;
    public static void main(String[] args) throws IOException {
        FastScanner sc=new FastScanner();
        int[][] points = new int[8][2];
        for (int i = 0; i < 8; i++) {
        	points[i][0] = sc.nextInt();
        	points[i][1] = sc.nextInt();
        }
        for (int i = 0; i < (1<<8); i++) {
        	ArrayList<Integer> subset = new ArrayList<Integer>();
            for (int j = 0; j < 8; j++) {
                if ((i & (1 << j)) > 0)
                	subset.add(j);
            }
            if (subset.size() == 4) {
            	boolean square = true;
            	for (int k = 0; k < 4; k++) {
            		int[] dists = new int[3];
            		for (int a = 0; a < 3; a++) {
            			dists[a] = dist(points[subset.get(k)],points[subset.get((k+a+1)%4)]);
            		}
            		Arrays.sort(dists);
            		if (dists[0] != dists[1] || dists[2] != 2*dists[0]) {
            			square = false;
            			break;
            		}
            	}
            	if (square) {
            		ArrayList<Integer> rec = new ArrayList<Integer>();
            		for (int j = 0; j < 8; j++) {
                        if ((i & (1 << j)) == 0)
                        	rec.add(j);
            		}

            		boolean isRec = true;
                	for (int k = 0; k < 4; k++) {
                		int[] dists = new int[3];
                		for (int a = 0; a < 3; a++) {
                			dists[a] = dist(points[rec.get(k)],points[rec.get((k+a+1)%4)]);
                		}
                		Arrays.sort(dists);
                		if (dists[2] != dists[0]+dists[1]) {
                			isRec = false;
                			break;
                		}
                	}

                	if (isRec) {
                		System.out.println("YES");
                		for (int x = 0; x < 4; x++)
                			System.out.print((subset.get(x)+1) + " ");
                		System.out.println();
                		for (int x = 0; x < 4; x++)
                			System.out.print((rec.get(x)+1) + " ");
                		System.out.println();
                		return;
                	}
            	}
            }
        }
        System.out.println("NO");
    }

    public static int dist(int[] point, int[] point2) {
    	return (int)(Math.pow((point2[1]-point[1]),2)+Math.pow((point2[0]-point[0]),2));
    }

    public static long gcd(long a, long b) {
    	if (b == 0)
    		return a;
    	else
    		return gcd(b,a%b);
    }

    public static int[][] sort(int[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    int[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<int[]>() {
			  @Override
        	  public int compare(int[] arr1, int[] arr2) {
	        	    if (arr1[0] != arr2[0])
	        	    	return arr1[0]-arr2[0];
	        	    else
	        	    	return arr1[1]-arr2[1];
	         }
		});
		return array;
	}

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.util.Scanner;

public class sample {
	static int[] x = new int[8];
	static int[] y = new int[8];
	static double eps = 1e-8;
	static boolean found = false;

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		for (int i = 0; i < 8; i++) {
			x[i] = in.nextInt();
			y[i] = in.nextInt();
		}
		perm(new int[8], new boolean[8], 0);
		if (!found)
			System.out.println("NO");
	}

	public static void perm(int[] a, boolean[] v, int at) {
		if (found)
			return;
		if (at == 8) {
			int[] A = { x[a[0]], y[a[0]] };
			int[] B = { x[a[1]], y[a[1]] };
			int[] C = { x[a[2]], y[a[2]] };
			int[] D = { x[a[3]], y[a[3]] };
			int[] i = { x[a[4]], y[a[4]] };
			int[] j = { x[a[5]], y[a[5]] };
			int[] k = { x[a[6]], y[a[6]] };
			int[] h = { x[a[7]], y[a[7]] };
			if (isSquare(A, B, C, D) && isRect(i, j, k, h)) {
				System.out.println("YES");
				System.out.printf("%d %d %d %d\n", a[0] + 1, a[1] + 1, a[2] + 1,
						a[3] + 1);
				System.out.printf("%d %d %d %d\n", a[4] + 1, a[5] + 1, a[6] + 1,
						a[7] + 1);
				found = true;
				return;
			}
		}
		for (int i = 0; i < v.length; i++) {
			if (!v[i]) {
				v[i] = true;
				a[at] = i;
				perm(a, v, at + 1);
				v[i] = false;
			}
		}
	}

	public static boolean isSquare(int[] A, int[] B, int[] C, int[] D) {
		double dist = dist(A, B);
		if (equals(dist, dist(B, C)) && equals(dist, dist(C, D))
				&& equals(dist, dist(D, A)))
			return isRect(A, B, C, D);
		return false;
	}

	public static boolean equals(double a, double b) {
		return Math.abs(a - b) <= eps;
	}

	public static boolean isRect(int[] A, int[] B, int[] C, int[] D) {
		if (dot(A, B, C) == 0 && dot(B, C, D) == 0 && dot(C, D, A) == 0
				&& dot(D, A, B) == 0) {
			int cross = cross(A, B, D);
			if (cross == cross(B, C, A) && cross == cross(C, D, B)
					&& cross == cross(D, A, C))
				return true;
		}
		return false;
	}

	public static int dot(int[] A, int[] B, int[] C) {
		// three points
		int[] AB = new int[2];
		int[] BC = new int[2];
		AB[0] = B[0] - A[0];
		AB[1] = B[1] - A[1];
		BC[0] = C[0] - B[0];
		BC[1] = C[1] - B[1];
		int dot = AB[0] * BC[0] + AB[1] * BC[1];
		return dot;
	}

	public static int cross(int[] A, int[] B, int[] C) {
		// three points
		int[] AB = new int[2];
		int[] AC = new int[2];
		AB[0] = B[0] - A[0];
		AB[1] = B[1] - A[1];
		AC[0] = C[0] - A[0];
		AC[1] = C[1] - A[1];
		return AB[0] * AC[1] - AB[1] * AC[0];
	}

	public static double dist(int[] A, int[] B) {
		// 2 points
		int a = A[0] - B[0];
		int b = A[1] - B[1];
		return Math.hypot(a, b);
	}
}


import java.util.Scanner;

public class sample {
    static int[] x = new int[8];
    static int[] y = new int[8];
    static double eps = 1e-8;
    static boolean found = false;

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        for (int i = 0; i < 8; i++) {
            x[i] = in.nextInt();
            y[i] = in.nextInt();
        }
        perm(new int[8], new boolean[8], 0);
        if (!found)
            System.out.println("NO");
    }

    public static void perm(int[] a, boolean[] v, int at) {
        if (found)
            return;
        if (at == 8) {
            int[] A = { x[a[0]], y[a[0]] };
            int[] B = { x[a[1]], y[a[1]] };
            int[] C = { x[a[2]], y[a[2]] };
            int[] D = { x[a[3]], y[a[3]] };
            int[] i = { x[a[4]], y[a[4]] };
            int[] j = { x[a[5]], y[a[5]] };
            int[] k = { x[a[6]], y[a[6]] };
            int[] h = { x[a[7]], y[a[7]] };
            if (isSquare(A, B, C, D) && isRect(i, j, k, h)) {
                System.out.println("YES");
                System.out.printf("%d %d %d %d\n", a[0] + 1, a[1] + 1, a[2] + 1,
                        a[3] + 1);
                System.out.printf("%d %d %d %d\n", a[4] + 1, a[5] + 1, a[6] + 1,
                        a[7] + 1);
                found = true;
                return;
            }
        }
        for (int i = 0; i < v.length; i++) {
            if (!v[i]) {
                v[i] = true;
                a[at] = i;
                perm(a, v, at + 1);
                v[i] = false;
            }
        }
    }

    public static boolean isSquare(int[] A, int[] B, int[] C, int[] D) {
        double dist = dist(A, B);
        if (equals(dist, dist(B, C)) && equals(dist, dist(C, D))
                && equals(dist, dist(D, A)))
            return isRect(A, B, C, D);
        return false;
    }

    public static boolean equals(double a, double b) {
        return a - b <= eps;
    }

    public static boolean isRect(int[] A, int[] B, int[] C, int[] D) {
        if (dot(A, B, C) == 0 && dot(B, C, D) == 0 && dot(C, D, A) == 0
                && dot(D, A, B) == 0) {
            int cross = cross(A, B, D);
            if (cross == cross(B, C, A) && cross == cross(C, D, B)
                    && cross == cross(D, A, C))
                return true;
        }
        return false;
    }

    public static int dot(int[] A, int[] B, int[] C) {
        // three points
        int[] AB = new int[2];
        int[] BC = new int[2];
        AB[0] = B[0] - A[0];
        AB[1] = B[1] - A[1];
        BC[0] = C[0] - B[0];
        BC[1] = C[1] - B[1];
        int dot = AB[0] * BC[0] + AB[1] * BC[1];
        return dot;
    }

    public static int cross(int[] A, int[] B, int[] C) {
        // three points
        int[] AB = new int[2];
        int[] AC = new int[2];
        AB[0] = B[0] - A[0];
        AB[1] = B[1] - A[1];
        AC[0] = C[0] - A[0];
        AC[1] = C[1] - A[1];
        return AB[0] * AC[1] - AB[1] * AC[0];
    }

    public static double dist(int[] A, int[] B) {
        // 2 points
        int a = A[0] - B[0];
        int b = A[1] - B[1];
        return Math.hypot(a, b);
    }
}


import java.util.*;
import java.math.*;

public class Main{
    static boolean checkCross(int x0, int x1, int x2, int x3, int y0, int y1, int y2, int y3){
        int check = (x1 - x0) * (x3 - x2) + (y1 - y0) * (y3 - y2);
        return check == 0;
    }

    static boolean isSquare(int[] x, int[] y){

        boolean test = true;
        int[] add = new int[4];
        for(int i = 1; i < 4; i++){
            for(int j = 1; j < 4; j++){
                if(i == j){
                    continue;
                }
                for(int k = 1; k < 4; k++){
                    if(j == k || i == k){
                        continue;
                    }
                    add[1] = i;
                    add[2] = j;
                    add[3] = k;
                    test = true;
                    for(int a = 0; a < 4; a++){
                        test &= checkCross(x[add[a]], x[add[(a + 1) % 4]], x[add[(a + 1) % 4]], x[add[(a + 2) % 4]],
                                y[add[a]], y[add[(a + 1) % 4]], y[add[(a + 1) % 4]], y[add[(a + 2) % 4]]);
                    }
                    if(test){
                        if((Math.abs(x[add[1]] - x[add[0]]) == Math.abs(y[add[2]] - y[add[1]])) && (Math.abs(y[add[1]] - y[add[0]]) == Math.abs(x[add[2]] - x[add[1]]))){
                            return true;
                        }
                    }
                }
            }
        }
        return false;
    }

    static boolean isRectangle(int[] x, int[] y){
        boolean test = true;
        int[] add = new int[4];
        for(int i = 1; i < 4; i++){
            for(int j = 1; j < 4; j++){
                if(i == j){
                    continue;
                }
                for(int k = 1; k < 4; k++){
                    if(j == k || i == k){
                        continue;
                    }
                    add[1] = i;
                    add[2] = j;
                    add[3] = k;
                    test = true;
                    for(int a = 0; a < 4; a++){
                        test &= checkCross(x[add[a]], x[add[(a + 1) % 4]], x[add[(a + 1) % 4]], x[add[(a + 2) % 4]],
                                y[add[a]], y[add[(a + 1) % 4]], y[add[(a + 1) % 4]], y[add[(a + 2) % 4]]);
                    }
                    if(test){
                        return true;
                    }
                }
            }
        }
        return false;
    }

    static int[] getArray(int[] arr, boolean[] type, boolean match){
        int count = 0;
        for(int i = 0; i < arr.length; i++){
            if(type[i] == match){
                count++;
            }
        }
        if(count == 4){
            int[] res = new int[4];
            for(int i = 0, j = 0; i < arr.length; i++){
                if(type[i] == match){
                    res[j++] = arr[i];
                }
            }
            return res;
        }
        return null;
    }

    static boolean search(boolean[] type, int[] x, int[] y, int index){
        if(index == 8){
            if(Arrays.equals(type, new boolean[]{false, false, false, false, true, true, true, true})){
                int a = 0;
            }
            int[] tx = getArray(x, type, true);
            int[] ty = getArray(y, type, true);
            if(tx == null || !isSquare(tx, ty)){
                return false;
            }
            tx = getArray(x, type, false);
            ty = getArray(y, type, false);
            return isRectangle(tx, ty);
        }
        type[index] = true;
        if(search(type, x, y, index + 1)){
            return true;
        }
        type[index] = false;
        return search(type, x, y, index + 1);
    }

    public static void main(String[] args) throws Exception{
        Scanner scan = new Scanner(System.in);
        int[] x = new int[8];
        int[] y = new int[8];
        for(int i = 0; i < 8; i++){
            x[i] = scan.nextInt();
            y[i] = scan.nextInt();
        }
        boolean[] type = new boolean[8];
        boolean res = search(type, x, y, 0);
        if(res){
            System.out.println("YES");
            boolean space = false;
            for(int i = 0; i < 8; i++){
                if(type[i]){
                    if(space){
                        System.out.print(" ");
                    }
                    space = true;
                    System.out.print(i + 1);
                }
            }
            System.out.println();
            space = false;
            for(int i = 0; i < 8; i++){
                if(!type[i]){
                    if(space){
                        System.out.print(" ");
                    }
                    space = true;
                    System.out.print(i + 1);
                }
            }
            System.out.println();
        }
        else{
            System.out.println("NO");
        }
    }
}


import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Main implements Runnable {

	private void solution() throws IOException {
		int[] x = new int[8];
		int[] y = new int[8];
		for (int i = 0; i < x.length; ++i) {
			x[i] = in.nextInt();
			y[i] = in.nextInt();
		}

		int resMask = -1;
		for (int mask = 0; mask < (1 << 8); ++mask) {
			if (Integer.bitCount(mask) == 4) {
				if (isSqure(mask, x, y) && isRect(((1 << 8) - 1) ^ mask, x, y)) {
					resMask = mask;
					break;
				}
			}
		}

		if (resMask == -1) {
			out.println("NO");
		} else {
			out.println("YES");
			out(resMask);
			out(((1 << 8) - 1) ^ resMask);
		}
	}

	private boolean isRect(int mask, int[] x, int[] y) {
		int[] px = new int[4];
		int[] py = new int[4];
		int ls = 0;
		for (int i = 0; i < 8; ++i) {
			if (((mask >> i) & 1) != 0) {
				px[ls] = x[i];
				py[ls] = y[i];
				++ls;
			}
		}

		return isRect(px, py);
	}

	private boolean isSqure(int mask, int[] x, int[] y) {
		int[] px = new int[4];
		int[] py = new int[4];
		int ls = 0;
		for (int i = 0; i < 8; ++i) {
			if (((mask >> i) & 1) != 0) {
				px[ls] = x[i];
				py[ls] = y[i];
				++ls;
			}
		}

		if (!isRect(px, py)) {
			return false;
		}

		double len = dist(0, 1, px, py);
		for (int i = 1; i < 4; ++i) {
			if (Math.abs(len - dist(i, (i + 1) % 4, px, py)) > 1e-9) {
				return false;
			}
		}
		return true;
	}

	private double dist(int i, int j, int[] px, int[] py) {
		return (px[i] - px[j]) * (px[i] - px[j]) + (py[i] - py[j]) * (py[i] - py[j]);
	}

	private boolean isRect(int[] x, int[] y) {
		for (int i = 0; i < x.length; ++i) {
			for (int j = 0; j < x.length; ++j) {
				if (compare(i, j, x, y) > 0) {
					int tmp = x[i];
					x[i] = x[j];
					x[j] = tmp;

					tmp = y[i];
					y[i] = y[j];
					y[j] = tmp;
				}
			}
		}

		for (int i = 0; i < 4; ++i) {
			if (!valid((i - 1 + 4) % 4, i, (i + 1) % 4, x, y)) {
				return false;
			}
		}
		return true;
	}

	private boolean valid(int i, int j, int k, int[] x, int[] y) {
		int x1 = x[i] - x[j];
		int y1 = y[i] - y[j];
		int x2 = x[k] - x[j];
		int y2 = y[k] - y[j];
		return (x1 * x2 + y1 * y2) == 0;
	}

	private int compare(int i, int j, int[] x, int[] y) {
		return Double.compare((x[i] - x[0]) * (y[j] - y[0]) - (x[j] - x[0]) * (y[i] - y[0]), 0);
	}

	private void out(int mask) {
		boolean space = false;
		for (int i = 0; i < 8; ++i) {
			if (((mask >> i) & 1) != 0) {
				if (space) {
					out.print(' ');
				} else {
					space = true;
				}
				out.print((i + 1));
			}
		}
		out.println();
	}

	@Override
	public void run() {
		try {
			solution();
			in.reader.close();
			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	private class Scanner {
		StringTokenizer tokenizer;
		BufferedReader reader;

		public Scanner(Reader reader) {
			this.reader = new BufferedReader(reader);
			this.tokenizer = new StringTokenizer("");
		}

		public boolean hasNext() throws IOException {
			while (!tokenizer.hasMoreTokens()) {
				String line = reader.readLine();
				if (line == null) {
					return false;
				}
				tokenizer = new StringTokenizer(line);
			}
			return true;
		}

		public String next() throws IOException {
			hasNext();
			return tokenizer.nextToken();
		}

		public String nextLine() throws IOException {
			tokenizer = new StringTokenizer("");
			return reader.readLine();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
	}

	public static void main(String[] args) {
		new Thread(null, new Main(), "", 1 << 28).start();
	}

	Scanner in = new Scanner(new InputStreamReader(System.in));
	PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
}


import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;

public class TaskD {
    /**
     * @param args
     */
    public static void main(String[] args) {
        TaskD task = new TaskD();
        task.read();
        task.write();
    }

    boolean was[] = new boolean[8];
    int perm[] = new int[8];
    int ax[] = new int[8];
    int ay[] = new int[8];
    boolean fullResult[] = new boolean[8];
    boolean res = false;
    int kp[] = new int[4];
    int n = 8;

    public void read() {
        Scanner in = new Scanner(System.in);
        for (int i = 0; i < n; i++) {
            ax[i] = in.nextInt();
            ay[i] = in.nextInt();
        }
        in.close();
    }

    private long dist(int q, int w) {
        return (ax[q] - ax[w]) * (ax[q] - ax[w]) + (ay[q] - ay[w])
                * (ay[q] - ay[w]);
    }

    private long dirSq() {
        long s = 0;
        for (int i = 0; i < 4; i++) {
            s += ax[kp[i]] * ay[kp[(1 + i) % 4]] - ax[kp[(1 + i) % 4]] * ay[kp[i]];
        }
        return s;
    }

    private boolean checkQuadro() {
        long d = dist(kp[0], kp[3]);
        for (int i = 0; i < 3; i++) {
            if (d != dist(kp[i], kp[1 + i])) {
                return false;
            }
        }
        if (d == 0) {
            return false;
        }
        return 2 * d == Math.abs(dirSq());
    }

    private boolean checkPryam() {
        long d1 = dist(kp[0], kp[3]);
        long d2 = dist(kp[0], kp[1]);
        if (d1 != dist(kp[1], kp[2]) || d2 != dist(kp[2], kp[3])) {
            return false;
        }
        if (d1 == 0 || d2 == 0) {
            return false;
        }
        return 4 * d1 * d2 == Math.abs(dirSq()) * Math.abs(dirSq());
    }

    private boolean genPerm(ArrayList<Integer> start, int q, boolean was[],
            boolean isQuadro) {
        if (q == 4) {
            if (isQuadro) {
                return checkQuadro();
            } else {
                return checkPryam();
            }
        }
        boolean fl = false;
        for (int i = 0; i < 4; i++) {
            if (!was[start.get(i)]) {
                was[start.get(i)] = true;
                kp[q] = start.get(i);
                fl = fl || genPerm(start, 1 + q, was, isQuadro);
                was[start.get(i)] = false;

            }
        }
        return fl;
    }

    private boolean check() {
        ArrayList<Integer> quadro = new ArrayList<Integer>();
        ArrayList<Integer> pry = new ArrayList<Integer>();
        for (int i = 0; i < n; i++) {
            if (was[i]) {
                quadro.add(i);
            } else {
                pry.add(i);
            }
        }
        boolean w[] = new boolean[8];
        if (genPerm(quadro, 0, w, true) && genPerm(pry, 0, w, false)) {
            return true;
        }
        return false;
    }

    private void rec(int q) {
        if (q == 4) {
            if (check()) {
                res = true;
                for (int i = 0; i < n; i++) {
                    fullResult[i] = was[i];
                }
            }
            return;
        }
        for (int i = 0; i < n; i++) {
            if (!was[i]) {
                was[i] = true;
                rec(1 + q);
                was[i] = false;
            }
        }

    }

    public void write() {
        PrintWriter out = new PrintWriter(System.out);
        rec(0);
        if (res) {
            out.println("YES");
            for (int i = 0; i < n; i++) {
                if (fullResult[i]) {
                    out.print(1 + i + " ");
                }

            }
            out.println();
            for (int i = 0; i < n; i++) {
                if (!fullResult[i]) {
                    out.print(1 + i + " ");
                }
            }
        } else {
            out.println("NO");
        }
        out.close();
    }
}


import java.awt.geom.Line2D;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class C97P4 {

    private static BufferedReader in;
    private static PrintWriter out;
    private static StringTokenizer input;

    static int [] x = new int[9];
    static int [] y = new int[9];
    public static void main(String[] args) throws IOException {
        //-------------------------------------------------------------------------
        //Initializing...
        new C97P4();
        //-------------------------------------------------------------------------
        //put your code here... :)
        for (int i = 1; i < 9; i++) {
            x[i]=nextInt();
            y[i]=nextInt();
        }
        boolean c = can(0);
        if(c){
            writeln("YES");
            for (int j = 0; j < 4; j++) {
                write(perm[j]+((j+1==4)?"\n":" "));
            }
            for (int j = 4; j < 8; j++) {

                write(perm[j]+((j+1==8)?"\n":" "));
            }
        }else
        writeln("NO");
        //-------------------------------------------------------------------------
        //closing up
        end();
        //--------------------------------------------------------------------------

    }

    static int [] perm = new int[8];
    static boolean [] vis =new boolean[9];
    static boolean can(int l){
        if(l==8)return check();
        boolean res=false;
        for (int i = 1; i < 9; i++) {
            if(!vis[i]){
                vis[i]=true;
                perm[l]=i;
                res|=can(l+1);
                if(res)return true;;
                vis[i]=false;
            }
        }
        return res;
    }

    private static boolean check() {
        // TODO Auto-generated method stub
        for (int i = 0; i < 4; i++) {
            if(!angle90s(perm[i],perm[ (i+1)%4], perm[(i+2)%4]))return false;
        }
        for (int i = 4; i < 8; i++) {
            if(!angle90(perm[i], perm[(i+1==8)?4:i+1], perm[(i+2==9)?5:(i+2==8)?4:i+2]))return false;
        }
        return true;
    }
    private static boolean angle90s(int i , int j , int k){
        int aa = (x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
        int bb = (x[j]-x[k])*(x[j]-x[k])+(y[j]-y[k])*(y[j]-y[k]);
        int cc = (x[i]-x[k])*(x[i]-x[k])+(y[i]-y[k])*(y[i]-y[k]);
        return aa+bb==cc&&aa==bb;
    }
    private static boolean angle90(int i , int j , int k){
        int aa = (x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
        int bb = (x[j]-x[k])*(x[j]-x[k])+(y[j]-y[k])*(y[j]-y[k]);
        int cc = (x[i]-x[k])*(x[i]-x[k])+(y[i]-y[k])*(y[i]-y[k]);
        return aa+bb==cc;
    }

    public C97P4() throws IOException {
        //Input Output for Console to be used for trying the test samples of the problem
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        //-------------------------------------------------------------------------
        //Initalize Stringtokenizer input
        input = new StringTokenizer(in.readLine());
    }

    private static int nextInt() throws IOException {
        if (!input.hasMoreTokens())input=new StringTokenizer(in.readLine());
        return Integer.parseInt(input.nextToken());
    }
    private static long nextLong() throws IOException {
        if (!input.hasMoreTokens())input=new StringTokenizer(in.readLine());
        return Long.parseLong(input.nextToken());
    }
    private static double nextDouble() throws IOException {
        if (!input.hasMoreTokens())input=new StringTokenizer(in.readLine());
        return Double.parseDouble(input.nextToken());
    }
    private static String nextString() throws IOException {
        if (!input.hasMoreTokens())input=new StringTokenizer(in.readLine());
        return input.nextToken();
    }
    private static void write(String output){
        out.write(output);
        out.flush();
    }
    private static void writeln(String output){
        out.write(output+"\n");
        out.flush();
    }
    private static void end() throws IOException{
        in.close();
        out.close();
        System.exit(0);
    }

}


import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class solver {
    FastScanner in = new FastScanner(System.in);
    PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException {
        new solver().solve();
    }

    int[] isQuad(Vec2 p1, Vec2 p2, Vec2 p3, Vec2 p4)
    {

        int[]ans = new int[4];
        if (p1.length(p2) == p1.length(p3) && p1.length(p2) == p2.length(p4) && p1.is90(p2, p3) && p4.is90(p2, p3) && p2.is90(p1, p4)) {
            ans[0] = p1.index;
            ans[1] = p2.index;
            ans[2] = p3.index;
            ans[3] = p4.index;
            return ans;
        }

        return null;
    }

    boolean isPPPP (Vec2 p1, Vec2 p2, Vec2 p3, Vec2 p4) {

        if (isQuad(p1, p2, p3, p4) != null) return true;

        if (p1.is90(p2, p3) && p4.is90(p2, p3) && p2.is90(p1, p4)) {
            return true;
        }

        return false;

    }

    void solve()  {

//      Vec2    v1 = new Vec2(0,0),
//              v2 = new Vec2(10,11),
//              v3 = new Vec2(10,0),
//              v4 = new Vec2(0,11);

//      Vec2    v1 = new Vec2(1,2),
//              v2 = new Vec2(2,3),
//              v3 = new Vec2(3,2),
//              v4 = new Vec2(2,1);

//      System.out.println(v3.is90(v1, v2));
//
        ArrayList<Vec2> list = new ArrayList<Vec2>();
//      list.add(v1);
//      list.add(v2);
//      list.add(v3);
//      list.add(v4);
//
//      for (int i = 0; i < list.size(); i++) {
//          for (int j = 0; j < list.size(); j++) {
//              for (int k = 0; k < list.size(); k++) {
//                  for (int l = 0; l < list.size(); l++) {
//                      if (i != j && i!=k && i!=l && j!=k && j!=l && k!=l) {
//
//                          System.out.println(isPPPP(list.get(i), list.get(j), list.get(k), list.get(l)));
//                      }
//                  }
//              }
//          }
//      }
//
//      Vec2    dir1_2 = v1.normalize(v2),
//              dir1_3 = v1.normalize(v3);
//
//
//      System.out.println(dir1_2.x + "," + dir1_2.y);
//      System.out.println(dir1_3.x + "," + dir1_3.y);
//
//      dir1_2.minus(dir1_3);
//      System.out.println(dir1_2.isNull());

        for (int i = 0; i < 8; i++) {
            Vec2 vec = new Vec2(in.nextInt(), in.nextInt());
            vec.index = i;
            list.add(vec);
        }

        for (int i = 0; i < list.size(); i++) {
            for (int j = 0; j < list.size(); j++) {
                for (int k = 0; k < list.size(); k++) {
                    for (int l = 0; l < list.size(); l++) {
                        if (i != j && i!=k && i!=l && j!=k && j!=l && k!=l) {

                            int[]tab = null;
                            tab = isQuad(list.get(i), list.get(j), list.get(k), list.get(l));
                            if (tab != null) {
                                ArrayList<Integer>qwerty = new ArrayList<Integer>();
                                for (int m = 0; m < 8; m++) {
                                    qwerty.add(new Integer(m));
                                }
                                for (int m = 0; m < tab.length; m++) {
                                    if (qwerty.contains(tab[m])) {
                                        qwerty.remove(new Integer(tab[m]));
                                    }
                                }
                                for (int i2 = 0; i2 < qwerty.size(); i2++) {
                                    for (int j2 = 0; j2 < qwerty.size(); j2++) {
                                        for (int k2 = 0; k2 < qwerty.size(); k2++) {
                                            for (int l2 = 0; l2 < qwerty.size(); l2++) {
                                                if (i2 != j2 && i2!=k2 && i2!=l2 && j2!=k2 && j2!=l2 && k2!=l2) {
                                                    if (isPPPP(list.get(qwerty.get(i2)), list.get(qwerty.get(j2)), list.get(qwerty.get(k2)), list.get(qwerty.get(l2)))){
                                                        System.out.println("YES");
                                                        for (int m = 0; m < tab.length; m++) {
                                                            System.out.print(tab[m] + 1 + " ");
                                                        }
                                                        System.out.println();
                                                        for (int m = 0; m < qwerty.size(); m++) {
                                                            System.out.print(qwerty.get(m) + 1 + " ");
                                                        }
                                                        return;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        System.out.println("NO");

    }

    public int min (int a, int b) {
        if (a < b) return a;
        else return b;
    }

    public int max (int a, int b) {
        if (a > b) return a;
        else return b;
    }

}

class FastScanner {
    BufferedReader br;
    StringTokenizer st;

    FastScanner(InputStream in) {
        br = new BufferedReader(new InputStreamReader(in));
    }

    String next() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                System.err.println(e);
                return "";
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    float nextFloat() {
        return Float.parseFloat(next());
    }

    BigInteger nextBigInt() {
        return new BigInteger(next());
    }

    void close() {
        try {
            br.close();
        } catch (IOException e) {
        }
    }
}
class Vec2
{
    public double x,y;
    public int index;

    Vec2()
    {
        x = 0;
        y = 0;
    }
    Vec2(float x, float y)
    {
        this.x = x;
        this.y = y;
    }
    double length()
    {
        return Math.sqrt(x*x + y*y);
    }
    double length(Vec2 vec)
    {
        double  X = Math.abs(vec.x - x),
                Y = Math.abs(vec.y - y);

        double buffer = Math.sqrt(X*X + Y*Y);

//      buffer *= 100;
//      buffer = (int)buffer;
//      buffer /= 100;
        return buffer;
    }

    void normalize ()
    {
        double length = length();
        x /= length;
        y /= length;
    }
    Vec2 normalize(Vec2 vec)
    {
        double length = length(vec);

        Vec2 result = new Vec2();

        result.x = x - vec.x;
        result.y = y - vec.y;

        result.x /= length;
        result.y /= length;

        result.x *= -1;
        result.y *= -1;

        return result;
    }

    void minus(Vec2 vec)
    {
        x -= vec.x;
        y -= vec.y;
    }

    boolean isNull()
    {
        if (x == 0) return true;
        if (y == 0) return true;
        if (x == 1) return true;
        if (y == 1) return true;
        if (x == -1) return true;
        if (y == -1) return true;
//      if (x == 1 && y == -1) return true;
//      if (x == 0 && y == 1) return true;
//      if (x == 0 && y == -1) return true;
//      if (x == -1 && y == 1) return true;
//      if (x == -1 && y == 0) return true;
//      if (x == -1 && y == -1) return true;

        return false;
    }

    boolean is90(Vec2 p2, Vec2 p3)
    {
        Vec2    dir1_2 = normalize(p2),
                dir1_3 = normalize(p3);

        dir1_2.minus(dir1_3);
//      if (dir1_2.isNull())return true;
//      else {
//          dir1_2.normalize();
//      }
        return dir1_2.isNull();
    }
}


import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class Main {

    public final FastScanner in;
    public final PrintWriter out;

    public Main(String mode) throws IOException {
        if (mode.equals("console")) {
            in = new FastScanner(System.in);
            out = new PrintWriter(System.out);
        } else {
            in = new FastScanner(new File("input.txt"));
            out = new PrintWriter(new BufferedWriter(new FileWriter(new File(
                    "output.txt"))));
        }
    }

    public void close() throws IOException {
        out.close();
    }

    public static void main(String[] args) throws IOException {
        Main task = new Main(IO_MODE.CONSOLE);
        task.solve();
        task.out.close();
    }

       int[] isQuad(Vector p1, Vector p2, Vector p3, Vector p4)
        {

            int[]ans = new int[4];
            if (p1.length(p2) == p1.length(p3) && p1.length(p2) == p2.length(p4) && p1.is90(p2, p3) && p4.is90(p2, p3) && p2.is90(p1, p4)) {
                ans[0] = p1.index;
                ans[1] = p2.index;
                ans[2] = p3.index;
                ans[3] = p4.index;
                return ans;
            }

            return null;
        }

        boolean isPPPP (Vector p1, Vector p2, Vector p3, Vector p4) {

            if (isQuad(p1, p2, p3, p4) != null) return true;

            if (p1.is90(p2, p3) && p4.is90(p2, p3) && p2.is90(p1, p4)) {
                return true;
            }

            return false;

        }

        public void test() {
            ArrayList<Vector> list= new ArrayList<Vector>();

//          Vector v1 = new Vector(0, 0), // A
//                  v2 = new Vector(4, 4), // B
//                  v3 = new Vector(4, 0), // C
//                  v4 = new Vector(0, 4); // D

            Vector v1 = new Vector(1, 2), // A
                    v2 = new Vector(2, 3), // B
                    v3 = new Vector(3, 2), // C
                    v4 = new Vector(2, 1); // D

            System.out.println(v1.length(v2));
            System.out.println(v2.length(v3));
            System.out.println(v3.length(v4));
            System.out.println(v4.length(v1));

            System.out.println(v1.is90(v2, v4));

            list.add(v1);
            list.add(v2);
            list.add(v3);
            list.add(v4);

            for (int i = 0; i < list.size(); i++) {
                for (int j = 0; j < list.size(); j++) {
                    for (int k = 0; k < list.size(); k++) {
                        for (int l = 0; l < list.size(); l++) {
                            if (i != j && i!=k && i!=l && j!=k && j!=l && k!=l) {
                                System.out.println(isPPPP(list.get(i), list.get(j), list.get(k), list.get(l)));
                            }
                        }
                    }
                }
            }
        }

    public void solve() throws IOException {
//      test();

        ArrayList<Vector> list = new ArrayList<Vector>();
        for (int i = 0; i < 8; i++) {
            Vector vec = new Vector(in.nextInt(), in.nextInt());
            vec.index = i;
            list.add(vec);
        }

        for (int i = 0; i < list.size(); i++) {
            for (int j = 0; j < list.size(); j++) {
                for (int k = 0; k < list.size(); k++) {
                    for (int l = 0; l < list.size(); l++) {
                        if (i != j && i!=k && i!=l && j!=k && j!=l && k!=l) {

                            int[]tab = null;
                            tab = isQuad(list.get(i), list.get(j), list.get(k), list.get(l));
                            if (tab != null) {
                                ArrayList<Integer>qwerty = new ArrayList<Integer>();
                                for (int m = 0; m < 8; m++) {
                                    qwerty.add(new Integer(m));
                                }
                                for (int m = 0; m < tab.length; m++) {
                                    if (qwerty.contains(tab[m])) {
                                        qwerty.remove(new Integer(tab[m]));
                                    }
                                }
                                for (int i2 = 0; i2 < qwerty.size(); i2++) {
                                    for (int j2 = 0; j2 < qwerty.size(); j2++) {
                                        for (int k2 = 0; k2 < qwerty.size(); k2++) {
                                            for (int l2 = 0; l2 < qwerty.size(); l2++) {
                                                if (i2 != j2 && i2!=k2 && i2!=l2 && j2!=k2 && j2!=l2 && k2!=l2) {
                                                    if (isPPPP(list.get(qwerty.get(i2)), list.get(qwerty.get(j2)), list.get(qwerty.get(k2)), list.get(qwerty.get(l2)))){
                                                        System.out.println("YES");
                                                        for (int m = 0; m < tab.length; m++) {
                                                            System.out.print(tab[m] + 1 + " ");
                                                        }
                                                        System.out.println();
                                                        for (int m = 0; m < qwerty.size(); m++) {
                                                            System.out.print(qwerty.get(m) + 1 + " ");
                                                        }
                                                        return;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        System.out.println("NO");

    }
}

class Vector {

    int index;
    double x, y;

    Vector() {
        x = 0;
        y = 0;
    }

    Vector(double x, double y) {
        this.x = x;
        this.y = y;
    }

    double length() {
        return Math.sqrt(x * x + y * y);
    }

    double length(Vector vec) {
        double X = Math.abs(vec.x - x), Y = Math.abs(vec.y - y);

        return Math.sqrt(X * X + Y * Y);
    }

    boolean is90(Vector p2, Vector p3) {
        double A = this.length(p2);
        double B = this.length(p3);
        double C = p2.length(p3);

        double res = round((A * A + B * B - C * C) / 2 * A * B);

        if (res == 0)
            return true;

        return false;
    }

    double round(double d) {
        d *= 1000;
        d = (int)d;
        d /= 1000;
        return d;
    }

}

class FastScanner {
    BufferedReader br;
    StringTokenizer st;

    FastScanner(InputStream in) {
        br = new BufferedReader(new InputStreamReader(in));
    }

    FastScanner(File file) throws FileNotFoundException {
        br = new BufferedReader(new FileReader(file));
    }

    String next() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                System.err.println(e);
                return "";
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    float nextFloat() {
        return Float.parseFloat(next());
    }

    BigInteger nextBigInt() {
        return new BigInteger(next());
    }

    void close() {
        try {
            br.close();
        } catch (IOException e) {
        }
    }
}

class IO_MODE {
    public static final String CONSOLE = "console";
    public static final String FILE = "file";
}


import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class solver {
    FastScanner in = new FastScanner(System.in);
    PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException {
        new solver().solve();
    }

    int[] isQuad(Vec2 p1, Vec2 p2, Vec2 p3, Vec2 p4)
    {

        int[]ans = new int[4];
        if (p1.length(p2) == p1.length(p3) && p1.length(p2) == p2.length(p4) && p1.is90(p2, p3) && p4.is90(p2, p3) && p2.is90(p1, p4)) {
            ans[0] = p1.index;
            ans[1] = p2.index;
            ans[2] = p3.index;
            ans[3] = p4.index;
            return ans;
        }

        return null;
    }

    boolean isPPPP (Vec2 p1, Vec2 p2, Vec2 p3, Vec2 p4) {

        if (isQuad(p1, p2, p3, p4) != null) return true;

        if (p1.is90(p2, p3) && p4.is90(p2, p3) && p2.is90(p1, p4)) {
            return true;
        }

        return false;

    }

    void solve()  {

        Vec2    v2 = new Vec2(8,168),
        v3 = new Vec2(-580,580),
        v4 = new Vec2(-496,84),
        v1 = new Vec2(-76,672);

//      Vec2    v1 = new Vec2(0,0),
//              v2 = new Vec2(10,11),
//              v3 = new Vec2(10,0),
//              v4 = new Vec2(0,11);

//      Vec2    v1 = new Vec2(1,2),
//              v2 = new Vec2(2,3),
//              v3 = new Vec2(3,2),
//              v4 = new Vec2(2,1);

        System.out.println(v1.is90(v2, v3));
//
        ArrayList<Vec2> list = new ArrayList<Vec2>();
        list.add(v1);
        list.add(v2);
        list.add(v3);
        list.add(v4);
//
        for (int i = 0; i < list.size(); i++) {
            for (int j = 0; j < list.size(); j++) {
                for (int k = 0; k < list.size(); k++) {
                    for (int l = 0; l < list.size(); l++) {
                        if (i != j && i!=k && i!=l && j!=k && j!=l && k!=l) {
                            System.out.println(isPPPP(list.get(i), list.get(j), list.get(k), list.get(l)));
                        }
                    }
                }
            }
        }
//
//      Vec2    dir1_2 = v1.normalize(v2),
//              dir1_3 = v1.normalize(v3);
//
//
//      System.out.println(dir1_2.x + "," + dir1_2.y);
//      System.out.println(dir1_3.x + "," + dir1_3.y);
//
//      dir1_2.minus(dir1_3);
//      System.out.println(dir1_2.isNull());

        for (int i = 0; i < 8; i++) {
            Vec2 vec = new Vec2(in.nextInt(), in.nextInt());
            vec.index = i;
            list.add(vec);
        }

        for (int i = 0; i < list.size(); i++) {
            for (int j = 0; j < list.size(); j++) {
                for (int k = 0; k < list.size(); k++) {
                    for (int l = 0; l < list.size(); l++) {
                        if (i != j && i!=k && i!=l && j!=k && j!=l && k!=l) {

                            int[]tab = null;
                            tab = isQuad(list.get(i), list.get(j), list.get(k), list.get(l));
                            if (tab != null) {
                                ArrayList<Integer>qwerty = new ArrayList<Integer>();
                                for (int m = 0; m < 8; m++) {
                                    qwerty.add(new Integer(m));
                                }
                                for (int m = 0; m < tab.length; m++) {
                                    if (qwerty.contains(tab[m])) {
                                        qwerty.remove(new Integer(tab[m]));
                                    }
                                }
                                for (int i2 = 0; i2 < qwerty.size(); i2++) {
                                    for (int j2 = 0; j2 < qwerty.size(); j2++) {
                                        for (int k2 = 0; k2 < qwerty.size(); k2++) {
                                            for (int l2 = 0; l2 < qwerty.size(); l2++) {
                                                if (i2 != j2 && i2!=k2 && i2!=l2 && j2!=k2 && j2!=l2 && k2!=l2) {
                                                    if (isPPPP(list.get(qwerty.get(i2)), list.get(qwerty.get(j2)), list.get(qwerty.get(k2)), list.get(qwerty.get(l2)))){
                                                        System.out.println("YES");
                                                        for (int m = 0; m < tab.length; m++) {
                                                            System.out.print(tab[m] + 1 + " ");
                                                        }
                                                        System.out.println();
                                                        for (int m = 0; m < qwerty.size(); m++) {
                                                            System.out.print(qwerty.get(m) + 1 + " ");
                                                        }
                                                        return;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        System.out.println("NO");

    }

    public int min (int a, int b) {
        if (a < b) return a;
        else return b;
    }

    public int max (int a, int b) {
        if (a > b) return a;
        else return b;
    }

}

class FastScanner {
    BufferedReader br;
    StringTokenizer st;

    FastScanner(InputStream in) {
        br = new BufferedReader(new InputStreamReader(in));
    }

    String next() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                System.err.println(e);
                return "";
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    float nextFloat() {
        return Float.parseFloat(next());
    }

    BigInteger nextBigInt() {
        return new BigInteger(next());
    }

    void close() {
        try {
            br.close();
        } catch (IOException e) {
        }
    }
}

class Vec2
{
    public double x,y;
    public int index;

    Vec2()
    {
        x = 0;
        y = 0;
    }
    Vec2(float x, float y)
    {
        this.x = x;
        this.y = y;
    }
    double length()
    {
        double buffer = Math.sqrt(x*x + y*y);

        buffer *= 1000;
        buffer = (int)buffer;
        buffer /= 1000;
        return buffer;
    }
    double length(Vec2 vec)
    {
        double  X = Math.abs(vec.x - x),
                Y = Math.abs(vec.y - y);

        double buffer = Math.sqrt(X*X + Y*Y);

        buffer *= 1000;
        buffer = (int)buffer;
        buffer /= 1000;
        return buffer;
    }

    void normalize ()
    {
        double length = length();
        x /= length;
        y /= length;
    }
    Vec2 normalize(Vec2 vec)
    {
        double length = length(vec);

        Vec2 result = new Vec2();

        result.x = x - vec.x;
        result.y = y - vec.y;

        result.x /= length;
        result.y /= length;

        result.x *= 1000;
        result.x = (int)result.x;
        result.x /= 1000;

        result.y *= 1000;
        result.y = (int)result.y;
        result.y /= 1000;

        result.x *= -1;
        result.y *= -1;

        return result;
    }

    void minus(Vec2 vec)
    {
        x -= vec.x;
        y -= vec.y;
    }

    boolean is90(Vec2 p2, Vec2 p3)
    {
        Vec2    dir1_2 = normalize(p2),
                dir1_3 = normalize(p3);

        return dir1_3.x == dir1_2.y && dir1_3.y == -dir1_2.x ||
                dir1_3.x == -dir1_2.y && dir1_3.y == dir1_2.x;
//      return Math.abs(dir1_2.x - dir1_3.x) == 1 ||
//              Math.abs(dir1_2.y - dir1_3.y) == 1;

//      return Math.abs(dir1_2.x) + Math.abs(dir1_2.y) == 1 || Math.abs(dir1_3.x) + Math.abs(dir1_3.y) == 1;
    }
}