import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class four {
    static int[] s;
    static int[] r;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        point[] points = new point[8];
        HashMap<String, Integer> map = new HashMap<String, Integer>();
        for (int i = 0; i < 8; i++) {
            int x = sc.nextInt();
            int y = sc.nextInt();
            points[i] = new point(x, y);
            map.put(x + "" + y, i);
        }
        boolean found = true;
        boolean[] v = new boolean[8];

        Arrays.sort(points);

        for (int i = 0; i < 8 && found; i++)
            for (int j = i + 1; j < 8 && found; j++)
                for (int k = j + 1; k < 8 && found; k++)
                    for (int l = k + 1; l < 8 && found; l++) {
                        Arrays.fill(v, true);
                        v[i] = false;
                        v[j] = false;
                        v[k] = false;
                        v[l] = false;
                        boolean check = check(v, points);
                        if (check) {
                            found = false;

                        }

                    }
        String ans = "";
        if (!found) {
            ans += "YES\n";

            int[] a1 = { map.get((points[s[0]].i + "" + points[s[0]].j)),
                    map.get((points[s[1]].i + "" + points[s[1]].j)),
                    map.get((points[s[2]].i + "" + points[s[2]].j)),
                    map.get((points[s[3]].i + "" + points[s[3]].j)) };
            Arrays.sort(a1);
            ans += (a1[0] + 1) + " " + (a1[1] + 1) + " " + (a1[2] + 1) + " "
                    + (a1[3] + 1) + "\n";
            int []a2 = { map.get((points[r[0]].i + "" + points[r[0]].j)),
                    map.get((points[r[1]].i + "" + points[r[1]].j)),
                    map.get((points[r[2]].i + "" + points[r[2]].j)),
                    map.get((points[r[3]].i + "" + points[r[3]].j)) };
            Arrays.sort(a2);
            ans += (a2[0] + 1) + " " + (a2[1] + 1) + " " + (a2[2] + 1) + " "
                    + (a2[3] + 1) + "\n";

        } else {
            ans += "NO\n";
        }
        System.out.print(ans);

    }

    private static boolean check(boolean[] v, point[] points) {
        int[] square = new int[4];
        int[] rect = new int[4];
        int in1 = 0;
        int in2 = 0;
        for (int i = 0; i < 8; i++)
            if (v[i])
                square[in1++] = i;
            else
                rect[in2++] = i;

        boolean check1 = checksquare(square, points);
        boolean check2 = checkRect(rect, points);
        if (check1 && check2) {
            s = square;
            r = rect;
            return true;
        } else {
            check1 = checksquare(rect, points);
            check2 = checkRect(square, points);
            if (check1 && check2) {
                s = square;
                r = rect;
                return true;
            }
        }

        return false;
    }

    private static boolean checkRect(int[] rect, point[] points) {
        if (points[rect[0]].j == points[rect[1]].j
                && points[rect[2]].i == points[rect[0]].i
                && points[rect[1]].i == points[rect[3]].i
                && points[rect[2]].j == points[rect[3]].j)
            return true;
        if (calcul(points, rect[0], rect[1]) == calcul(points, rect[2], rect[3])
                && calcul(points, rect[1], rect[2]) == calcul(points, rect[0],
                        rect[3])) {
            if (slope(points, rect[0], rect[1]) == slope(points, rect[2],
                    rect[3]))
                return true;
        }
        return false;
    }

    private static boolean checksquare(int[] square, point[] points) {
        if (points[square[0]].j == points[square[1]].j
                && points[square[2]].i == points[square[0]].i
                && points[square[1]].i == points[square[3]].i
                && points[square[2]].j == points[square[3]].j)
            return true;
        int d = calcul(points, square[0], square[1]);
        if (calcul(points, square[0], square[2]) == d
                && calcul(points, square[1], square[2]) == d
                && calcul(points, square[2], square[3]) == d) {
            if (slope(points, square[0], square[1]) == slope(points, square[2],
                    square[3]))
                return true;
        }
        return false;
    }

    private static double slope(point[] points, int i, int j) {
        if (points[i].i != points[j].i)
            return (points[i].j - points[j].j * 1.0)
                    / (points[i].i - points[j].i);
        return Double.MAX_VALUE;
    }

    private static int calcul(point[] points, int i, int j) {

        return (points[i].i - points[j].i) * (points[i].i - points[j].i)
                + (points[i].j - points[j].j) * (points[i].j - points[j].j);
    }

    static class point implements Comparable<point> {

        int i;
        int j;

        public point(int ii, int jj) {
            i = ii;
            j = jj;
        }

        public int compareTo(point arg0) {
            // TODO Auto-generated method stub
            if (j < arg0.j)
                return 1;
            else if (j > arg0.j)
                return -1;
            else if (i < arg0.i)
                return 1;
            else
                return -1;
        }

    }

}


import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class four {
    static int[] s;
    static int[] r;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        point[] points = new point[8];
        HashMap<String, Integer> map = new HashMap<String, Integer>();
        for (int i = 0; i < 8; i++) {
            int x = sc.nextInt();
            int y = sc.nextInt();
            points[i] = new point(x, y);
            map.put(x + "" + y, i);
        }
        boolean found = true;
        boolean[] v = new boolean[8];

        Arrays.sort(points);

        for (int i = 0; i < 8 && found; i++)
            for (int j = i + 1; j < 8 && found; j++)
                for (int k = j + 1; k < 8 && found; k++)
                    for (int l = k + 1; l < 8 && found; l++) {
                        Arrays.fill(v, true);
                        v[i] = false;
                        v[j] = false;
                        v[k] = false;
                        v[l] = false;
                        boolean check = check(v, points);
                        if (check) {
                            found = false;

                        }

                    }
        String ans = "";
        if (!found) {
            ans += "YES\n";

            int[] a1 = { map.get((points[s[0]].i + "" + points[s[0]].j)),
                    map.get((points[s[1]].i + "" + points[s[1]].j)),
                    map.get((points[s[2]].i + "" + points[s[2]].j)),
                    map.get((points[s[3]].i + "" + points[s[3]].j)) };
            Arrays.sort(a1);
            ans += (a1[0] + 1) + " " + (a1[1] + 1) + " " + (a1[2] + 1) + " "
                    + (a1[3] + 1) + "\n";
            int []a2 = { map.get((points[r[0]].i + "" + points[r[0]].j)),
                    map.get((points[r[1]].i + "" + points[r[1]].j)),
                    map.get((points[r[2]].i + "" + points[r[2]].j)),
                    map.get((points[r[3]].i + "" + points[r[3]].j)) };
            Arrays.sort(a2);
            ans += (a2[0] + 1) + " " + (a2[1] + 1) + " " + (a2[2] + 1) + " "
                    + (a2[3] + 1) + "\n";

        } else {
            ans += "NO\n";
        }
        System.out.print(ans);

    }

    private static boolean check(boolean[] v, point[] points) {
        int[] square = new int[4];
        int[] rect = new int[4];
        int in1 = 0;
        int in2 = 0;
        for (int i = 0; i < 8; i++)
            if (v[i])
                square[in1++] = i;
            else
                rect[in2++] = i;

        boolean check1 = checksquare(square, points);
        boolean check2 = checkRect(rect, points);
        if (check1 && check2) {
            s = square;
            r = rect;
            return true;
        } else {
            check1 = checksquare(rect, points);
            check2 = checkRect(square, points);
            if (check1 && check2) {
                s = square;
                r = rect;
                return true;
            }
        }

        return false;
    }

    private static boolean checkRect(int[] rect, point[] points) {
        if (points[rect[0]].j == points[rect[1]].j
                && points[rect[2]].i == points[rect[0]].i
                && points[rect[1]].i == points[rect[3]].i
                && points[rect[2]].j == points[rect[3]].j)
            return true;
        if (calcul(points, rect[0], rect[1]) == calcul(points, rect[2], rect[3])
                && calcul(points, rect[1], rect[2]) == calcul(points, rect[0],
                        rect[3])) {
            if (slope(points, rect[0], rect[1]) == slope(points, rect[2],
                    rect[3]))
                return true;
        }
        return false;
    }

    private static boolean checksquare(int[] square, point[] points) {
        if (points[square[0]].j == points[square[1]].j
                && points[square[2]].i == points[square[0]].i
                && points[square[1]].i == points[square[3]].i
                && points[square[2]].j == points[square[3]].j)
            return true;
        int d = calcul(points, square[0], square[1]);
        if (calcul(points, square[0], square[2]) == d
                && calcul(points, square[1], square[2]) == d
                && calcul(points, square[2], square[3]) == d) {
            if (slope(points, square[0], square[1]) == slope(points, square[2],
                    square[3]))
                return true;
        }
        return false;
    }

    private static double slope(point[] points, int i, int j) {
        if (points[i].i != points[j].i)
            return (points[i].j - points[j].j * 1.0)
                    / (points[i].i - points[j].i);
        return Double.MAX_VALUE;
    }

    private static int calcul(point[] points, int i, int j) {

        return (points[i].i - points[j].i) * (points[i].i - points[j].i)
                + (points[i].j - points[j].j) * (points[i].j - points[j].j);
    }

    static class point implements Comparable<point> {

        int i;
        int j;

        public point(int ii, int jj) {
            i = ii;
            j = jj;
        }

        public int compareTo(point arg0) {
            // TODO Auto-generated method stub
            if (j < arg0.j)
                return 1;
            else if (j > arg0.j)
                return -1;
            else if (i > arg0.i)
                return 1;
            else
                return -1;
        }

    }

}


import java.util.Arrays;
import java.util.Scanner;

public class four {
    static int [] s;
    static int [] r;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        point[] points = new point[8];
        for (int i = 0; i < 8; i++) {
            points[i]=new point(sc.nextInt(),sc.nextInt());
        }
        boolean found=true;
        boolean[] v = new boolean[8];
        Arrays.sort(points);

        for (int i = 0; i < 8&&true; i++)
            for (int j = i + 1; j < 8&&true; j++)
                for (int k = j + 1; k < 8&&true; k++)
                    for (int l = k + 1; l < 8&&true; l++) {
                        Arrays.fill(v, true);
                        v[i] = false;
                        v[j] = false;
                        v[k] = false;
                        v[l] = false;
                        boolean check=check(v, points);
                        if(check)
                        {
                            found=false;

                        }

                    }
        String ans = "";
        if(!found)
        {
            ans+="YES\n";

            ans+=(r[0]+1)+" "+(r[1]+1)+" "+(r[2]+1)+" "+(r[3]+1)+"\n";
            ans+=(s[0]+1)+" "+(s[1]+1)+" "+(s[2]+1)+" "+(s[3]+1)+"\n";

        }
        else {
            ans+="NO\n";
        }
        System.out.print(ans);

    }

    private static boolean check(boolean[] v, point[] points) {
        int[] square = new int[4];
        int[] rect = new int[4];
        int in1 = 0;
        int in2 = 0;
        for (int i = 0; i < 8; i++)
            if (v[i])
                square[in1++] = i;
            else
                rect[in2++] = i;

        boolean check1 = checksquare(square, points);
        boolean check2 = checkRect(rect, points);
        if (check1 && check2)
        {
            s=square;
            r=rect;
            return true;
        }
        else {
         check1 = checksquare(rect, points);
         check2 = checkRect(square, points);
         if (check1 && check2)
            {
                s=square;
                r=rect;
                return true;
            }
        }

        return false;
    }

    private static boolean checkRect(int[] rect, point[] points) {
        if(points[rect[0]].j==points[rect[1]].j&&points[rect[2]].i==points[rect[0]].i&&points[rect[1]].i==points[rect[3]].i&&points[rect[2]].j==points[rect[3]].j)
            return true;
        if (calcul(points, rect[0], rect[1]) == calcul(points, rect[2], rect[3])
                && calcul(points, rect[1], rect[2]) == calcul(points, rect[0],
                        rect[3])) {
            if (slope(points, rect[0], rect[1]) == slope(points, rect[2],
                    rect[3]))
                return true;
        }
        return false;
    }

    private static boolean checksquare(int[] square, point[] points) {
        if(points[square[0]].j==points[square[1]].j&&points[square[2]].i==points[square[0]].i&&points[square[1]].i==points[square[3]].i&&points[square[2]].j==points[square[3]].j)
            return true;
        int d = calcul(points, square[0], square[1]);
        if (calcul(points, square[0], square[2]) == d
                && calcul(points, square[1], square[2]) == d
                && calcul(points, square[2], square[3]) == d) {
            if (slope(points, square[0], square[1]) == slope(points, square[2],
                    square[3]))
                return true;
        }
        return false;
    }

    private static double slope(point[] points, int i, int j) {
        if (points[i].i != points[j].i)
            return (points[i].j - points[j].j* 1.0)
                    / (points[i].i - points[j].i);
        return Double.MAX_VALUE;
    }

    private static int calcul(point[] points, int i, int j) {

        return (points[i].i - points[j].i) * (points[i].i - points[j].i)
                + (points[i].j - points[j].j) * (points[i].j - points[j].j);
    }
    static class point implements Comparable<point>
    {

        int i;
        int j;
        public point(int ii,int jj) {
            i=ii;
            j=jj;
        }
        public int compareTo(point arg0) {
            // TODO Auto-generated method stub
            if(j<arg0.j)
                return 1;
            else if(j>arg0.j)
                return -1;
            else if(i>arg0.i)
                return 1;
            else return -1;
        }

    }

}


import java.util.Arrays;
import java.util.Scanner;

public class four {
    static int [] s;
    static int [] r;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        point[] points = new point[8];
        for (int i = 0; i < 8; i++) {
            points[i]=new point(sc.nextInt(),sc.nextInt());
        }
        boolean found=true;
        boolean[] v = new boolean[8];
        Arrays.sort(points);

        for (int i = 0; i < 8&&true; i++)
            for (int j = i + 1; j < 8&&true; j++)
                for (int k = j + 1; k < 8&&true; k++)
                    for (int l = k + 1; l < 8&&true; l++) {
                        Arrays.fill(v, true);
                        v[i] = false;
                        v[j] = false;
                        v[k] = false;
                        v[l] = false;
                        boolean check=check(v, points);
                        if(check)
                        {
                            found=false;

                        }

                    }
        String ans = "";
        if(!found)
        {
            ans+="YES\n";
            ans+=(s[0]+1)+" "+(s[1]+1)+" "+(s[2]+1)+" "+(s[3]+1)+"\n";
            ans+=(r[0]+1)+" "+(r[1]+1)+" "+(r[2]+1)+" "+(r[3]+1)+"\n";

        }
        else {
            ans+="NO\n";
        }
        System.out.print(ans);

    }

    private static boolean check(boolean[] v, point[] points) {
        int[] square = new int[4];
        int[] rect = new int[4];
        int in1 = 0;
        int in2 = 0;
        for (int i = 0; i < 8; i++)
            if (v[i])
                square[in1++] = i;
            else
                rect[in2++] = i;

        boolean check1 = checksquare(square, points);
        boolean check2 = checkRect(rect, points);
        if (check1 && check2)
        {
            s=square;
            r=rect;
            return true;
        }
        else {
         check1 = checksquare(rect, points);
         check2 = checkRect(square, points);
         if (check1 && check2)
            {
                s=square;
                r=rect;
                return true;
            }
        }

        return false;
    }

    private static boolean checkRect(int[] rect, point[] points) {
        if(points[rect[0]].j==points[rect[1]].j&&points[rect[2]].i==points[rect[0]].i&&points[rect[1]].i==points[rect[3]].i&&points[rect[2]].j==points[rect[3]].j)
            return true;
        if (calcul(points, rect[0], rect[1]) == calcul(points, rect[2], rect[3])
                && calcul(points, rect[1], rect[2]) == calcul(points, rect[0],
                        rect[3])) {
            if (slope(points, rect[0], rect[1]) == slope(points, rect[2],
                    rect[3]))
                return true;
        }
        return false;
    }

    private static boolean checksquare(int[] square, point[] points) {
        if(points[square[0]].j==points[square[1]].j&&points[square[2]].i==points[square[0]].i&&points[square[1]].i==points[square[3]].i&&points[square[2]].j==points[square[3]].j)
            return true;
        int d = calcul(points, square[0], square[1]);
        if (calcul(points, square[0], square[2]) == d
                && calcul(points, square[1], square[2]) == d
                && calcul(points, square[2], square[3]) == d) {
            if (slope(points, square[0], square[1]) == slope(points, square[2],
                    square[3]))
                return true;
        }
        return false;
    }

    private static double slope(point[] points, int i, int j) {
        if (points[i].i != points[j].i)
            return (points[i].j - points[j].j* 1.0)
                    / (points[i].i - points[j].i);
        return Double.MAX_VALUE;
    }

    private static int calcul(point[] points, int i, int j) {

        return (points[i].i - points[j].i) * (points[i].i - points[j].i)
                + (points[i].j - points[j].j) * (points[i].j - points[j].j);
    }
    static class point implements Comparable<point>
    {

        int i;
        int j;
        public point(int ii,int jj) {
            i=ii;
            j=jj;
        }
        public int compareTo(point arg0) {
            // TODO Auto-generated method stub
            if(j<arg0.j)
                return 1;
            else if(j>arg0.j)
                return -1;
            else if(i>arg0.i)
                return 1;
            else return -1;
        }

    }

}


import java.util.*;
import java.io.*;
public class C97D{
    static BufferedReader br;
    public static void main(String args[])throws Exception{
        br=new BufferedReader(new InputStreamReader(System.in));
        Point p[]=new Point[8];
        for(int i=0;i<8;i++){

            int nm[]=toIntArray();
            p[i]=new Point(nm[0],nm[1]);
        }
        boolean used[]=new boolean[8];
        for(int p1=0;p1<8;p1++)
            for(int p2=0;p2<8;p2++)
                if(p1!=p2)
                for(int p3=0;p3<8;p3++)
                    if(p2!=p3 && p1!=p3)
                    for(int p4=0;p4<8;p4++)
                        if(p1!=p4 && p2!=p4 && p3!=p4){
                            Arrays.fill(used, false);
                            int a=isRect(p[p1],p[p2],p[p3],p[p4]);
                            used[p1]=true;
                            used[p2]=true;
                            used[p3]=true;
                            used[p4]=true;

                            if(a==2){
                                Point t[]=new Point[4];
                                int c=0;
                                for(int i=0;i<8;i++){
                                    if(!used[i])
                                        t[c++]=p[i];
                                }
                                int b=isRect(t);
                                if(b>0){
                                    prln("YES");
                                    prln((p1+1)+" "+(p2+1)+" "+(p3+1)+" "+(p4+1));
                                    for(int i=0;i<8;i++){
                                        if(!used[i])
                                            pr((i+1)+" ");
                                    }
                                    prln("");
                                    return;
                                }
                            }

                        }

                        prln("NO");

    }
    public static int isRect(Point p1,Point p2,Point p3,Point p4){
       int ret=0;
       int x1=p1.x;
       int x2=p2.x;
       int x3=p3.x;
       int x4=p4.x;
       int y1=p1.y;
       int y2=p2.y;
       int y3=p3.y;
       int y4=p4.y;

       x2 -= x1; x3 -= x1; x4 -= x1; y2 -= y1; y3 -= y1; y4 -= y1;
      if((x2 + x3 == x4 && y2 + y3 == y4 && x2 * x3 == -y2 * y3) ||
        (x2 + x4 == x3 && y2 + y4 == y3 && x2 * x4 == -y2 * y4) ||
        (x3 + x4 == x2 && y3 + y4 == y2 && x3 * x4 == -y3 * y4)){
          if(sqr(p1,p2,p3)){
              ret=2;
          }
          else ret=1;
      }
       return ret;
    }
    public static int isRect(Point p[]){
       int ret=0;
       int x1=p[0].x;
       int x2=p[1].x;
       int x3=p[2].x;
       int x4=p[3].x;
       int y1=p[0].y;
       int y2=p[1].y;
       int y3=p[2].y;
       int y4=p[3].y;

       x2 -= x1; x3 -= x1; x4 -= x1; y2 -= y1; y3 -= y1; y4 -= y1;
      if((x2 + x3 == x4 && y2 + y3 == y4 && x2 * x3 == -y2 * y3) ||
        (x2 + x4 == x3 && y2 + y4 == y3 && x2 * x4 == -y2 * y4) ||
        (x3 + x4 == x2 && y3 + y4 == y2 && x3 * x4 == -y3 * y4)){
          if(sqr(p[0],p[1],p[2])){
              ret=2;
          }
          else ret=1;
      }
       return ret;
    }
    public static boolean sqr(Point p1, Point p2, Point p3){
        double a=Math.sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y));
        double b=Math.sqrt((p2.x-p3.x)*(p2.x-p3.x)+(p2.y-p3.y)*(p2.y-p3.y));
        double c=Math.sqrt((p1.x-p3.x)*(p1.x-p3.x)+(p1.y-p3.y)*(p1.y-p3.y));
        return (a==b && a<c)|| (b==c && b<c) || (a==c && a<b);

    }
    /****************************************************************/
    public static int[] toIntArray()throws Exception{
       String str[]=br.readLine().split(" ");
       int k[]=new int[str.length];
       for(int i=0;i<str.length;i++){
            k[i]=Integer.parseInt(str[i]);
       }
       return k;
    }
    public static int toInt()throws Exception{
       return Integer.parseInt(br.readLine());
    }
    public static long[] toLongArray()throws Exception{
       String str[]=br.readLine().split(" ");
       long k[]=new long[str.length];
       for(int i=0;i<str.length;i++){
            k[i]=Long.parseLong(str[i]);
       }
       return k;
    }
    public static long toLong()throws Exception{
       return Long.parseLong(br.readLine());
    }
    public static double[] toDoubleArray()throws Exception{
       String str[]=br.readLine().split(" ");
       double k[]=new double[str.length];
       for(int i=0;i<str.length;i++){
            k[i]=Double.parseDouble(str[i]);
       }
       return k;
    }
    public static double toDouble()throws Exception{
       return Double.parseDouble(br.readLine());
    }
    public static String toStr()throws Exception{
       return br.readLine();
    }
    public static String[] toStrArray()throws Exception{
       String str[]=br.readLine().split(" ");
       return str;
    }
    public static void pr(Object st){
	System.out.print(st);
    }
    public static void prln(Object st){
	System.out.println(st);
    }
    /****************************************************************/

}
class Point{
    int x;
    int y;
    public Point(int xx, int yy){
        x=xx;
        y=yy;
    }

}


import java.util.Scanner;

public class D {
    int order[] = new int[4];

    private static boolean isSquare(int x[], int y[]) {
        String[] orders = { "0123", "0132", "0231" };
        line[] lines = new line[4];

        for (int i = 0; i < orders.length; i++) {
            lines[0] = new line(x[orders[i].charAt(0) - '0'],
                    y[orders[i].charAt(0) - '0'], x[orders[i].charAt(1) - '0'],
                    y[orders[i].charAt(1) - '0']);
            lines[1] = new line(x[orders[i].charAt(0) - '0'],
                    y[orders[i].charAt(0) - '0'], x[orders[i].charAt(2) - '0'],
                    y[orders[i].charAt(2) - '0']);
            if (lines[0].len() - lines[1].len() > 1e-9)
                continue;

            lines[2] = new line(x[orders[i].charAt(3) - '0'],
                    y[orders[i].charAt(3) - '0'], x[orders[i].charAt(1) - '0'],
                    y[orders[i].charAt(1) - '0']);
            if (lines[1].len() - lines[2].len() > 1e-9)
                continue;

            lines[3] = new line(x[orders[i].charAt(3) - '0'],
                    y[orders[i].charAt(3) - '0'], x[orders[i].charAt(2) - '0'],
                    y[orders[i].charAt(2) - '0']);
            if (lines[1].len() - lines[3].len() > 1e-9)
                continue;
            if (isperp(lines[0], lines[1]) && isperp(lines[2], lines[3]))
                if (lines[0].len() > 0 && lines[1].len() > 0
                        && lines[2].len() > 0 && lines[3].len() > 0)
                    return true;
        }
        return false;
    }

    private static boolean isRect(int x[], int y[]) {
        String[] orders = { "0123", "0132", "0231" };
        line[] lines = new line[4];

        for (int i = 0; i < orders.length; i++) {
            lines[0] = new line(x[orders[i].charAt(0) - '0'],
                    y[orders[i].charAt(0) - '0'], x[orders[i].charAt(1) - '0'],
                    y[orders[i].charAt(1) - '0']);
            lines[1] = new line(x[orders[i].charAt(0) - '0'],
                    y[orders[i].charAt(0) - '0'], x[orders[i].charAt(2) - '0'],
                    y[orders[i].charAt(2) - '0']);

            lines[2] = new line(x[orders[i].charAt(3) - '0'],
                    y[orders[i].charAt(3) - '0'], x[orders[i].charAt(1) - '0'],
                    y[orders[i].charAt(1) - '0']);

            lines[3] = new line(x[orders[i].charAt(3) - '0'],
                    y[orders[i].charAt(3) - '0'], x[orders[i].charAt(2) - '0'],
                    y[orders[i].charAt(2) - '0']);

            if (isperp(lines[0], lines[1]) && isperp(lines[2], lines[3]))
                if (lines[0].len() > 0 && lines[1].len() > 0
                        && lines[2].len() > 0 && lines[3].len() > 0)
                    return true;
        }
        return false;
    }

    public static void main(String[] args) {
        Scanner myScanner = new Scanner(System.in);
        int[] x = new int[8], y = new int[8];
        for (int i = 0; i < 8; i++) {
            x[i] = myScanner.nextInt();
            y[i] = myScanner.nextInt();
        }
        int cnt1, cnt2;
        int[] squX = new int[4], squY = new int[4], rectx = new int[4], recty = new int[4];
        String sq = "", rec = "";

        for (int i = 0; i < 8; i++)
            for (int j = i + 1; j < 8; j++)
                for (int k = j + 1; k < 8; k++)
                    for (int l = k + 1; l < 8; l++) {
                        cnt1 = cnt2 = 0;
                        sq = rec = "";
                        for (int ii = 0; ii < 8; ii++)
                            if (ii == i || ii == j || ii == k | ii == l) {
                                squX[cnt1] = x[ii];
                                squY[cnt1++] = y[ii];
                                sq += " " + (ii + 1);
                            } else {
                                rectx[cnt2] = x[ii];
                                recty[cnt2++] = y[ii];
                                rec += " " + (ii + 1);
                            }
                        if (isSquare(squX, squY) && isRect(rectx, recty)) {
                            System.out.println("YES");
                            System.out.println(sq.substring(1));
                            System.out.println(rec.substring(1));
                            System.exit(0);
                        }
                    }

        System.out.println("NO");
    }

    private static boolean isperp(line a, line b) {
        if (Math.abs((a.x1 - a.x2) * (b.x1 - b.x2) + (a.y1 - a.y2)
                * (b.y1 - b.y2)) < 1e-9)
            return true;
        return false;
    }

    static class line {
        int x1, y1, x2, y2;

        public line(int x1, int y1, int x2, int y2) {
            this.x1 = x1;
            this.y1 = y1;
            this.x2 = x2;
            this.y2 = y2;
        }

        private double len() {
            return Math.hypot(x1 - x2, y1 - y2);
        }

        @Override
        public String toString() {
            return x1 + " " + y1 + " " + x2 + " " + y2;
        }
    }
}


import java.awt.Point;
import java.util.Scanner;

public class D {
    static Point[] P = new Point[8];
    static int[] A = new int[8];

    public static int norm(Point x) {
        return x.x * x.x + x.y * x.y;
    }

    public static int dot(Point x, Point y) {
        return x.x * y.x + x.y * y.y;
    }

    public static boolean checkSquare() {
        for (int i = 0; i < 4; i++)
            for (int j = i + 1; j < 4; j++)
                if (P[A[i]].x == P[A[j]].x && P[A[i]].y == P[A[j]].y)
                    return false;
        Point[] V = new Point[4];
        for (int i = 0; i < 4; i++) {
            V[i] = new Point(P[A[i]].x - P[A[(i + 1) % 4]].x, P[A[i]].y
                    - P[A[(i + 1) % 4]].y);
        }

        for (int i = 0; i < 4; i++)
            if (dot(V[i], V[(i + 1) % 4]) != 0) {
                return false;
            }
        for (int i = 0; i < 4; i++)
            if (norm(V[i]) != norm(V[0]))
                return false;
        return true;
    }

    public static boolean checkRectangle() {
        for (int i = 4; i < 8; i++)
            for (int j = i + 1; j < 8; j++)
                if (P[A[i]].x == P[A[j]].x && P[A[i]].y == P[A[j]].y)
                    return false;
        Point[] V = new Point[4];
        for (int i = 4; i < 8; i++) {
            V[i % 4] = new Point(P[A[i]].x - P[A[(i + 1) % 4 + 4]].x, P[A[i]].y
                    - P[A[(i + 1) % 4 + 4]].y);
        }
        for (int i = 0; i < 4; i++)
            if (dot(V[i], V[(i + 1) % 4]) != 0) {
                return false;
            }
        return true;
    }

    public static void rec(int index) {
        if (index == 8) {
            if (checkSquare() && checkRectangle()) {
                System.out.println("YES");
                for (int i = 0; i < 4; i++)
                    System.out.print(A[i] + 1 + " ");
                System.out.println();
                for (int i = 4; i < 8; i++)
                    System.out.print(A[i] + 1 + " ");
                System.out.println();
                System.exit(0);
            }

        }
        for (int i = index; i < 8; i++) {
            int temp = A[i];
            A[i] = A[index];
            A[index] = temp;
            rec(index + 1);
            temp = A[i];
            A[i] = A[index];
            A[index] = temp;
        }
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        for (int i = 0; i < 8; i++) {
            P[i] = new Point(in.nextInt(), in.nextInt());
            A[i] = i;
        }
        rec(0);
        System.out.println("NO");
    }
}


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

public class TaskB {
	BufferedReader br;
	PrintWriter out;
	StringTokenizer stok;

	String nextToken() throws IOException {
		while (stok == null || !stok.hasMoreTokens()) {
			String s = br.readLine();
			if (s == null) {
				return "-1";
			}
			stok = new StringTokenizer(s);
		}
		return stok.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());
	}

	char nextChar() throws IOException {
		return (char) (br.read());
	}

	String nextLine() throws IOException {
		return br.readLine();
	}

	int[] x = new int[8];
	int[] y = new int[8];

	long dist(int x1, int y1, int x2, int y2) {
		return ((long) (x1) - (long) (x2)) * ((long) (x1) - (long) (x2))
				+ ((long) (y1) - (long) (y2)) * ((long) (y1) - (long) (y2));
	}

	boolean perp(int x1, int y1, int x2, int y2) {
		return x1 * x2 + y1 * y2 == 0;
	}

	boolean ok1(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) {
		if (!perp(x1 - x2, y1 - y2, x3 - x2, y3 - y2)
				|| !perp(x2 - x3, y2 - y3, x4 - x3, y4 - y3)
				|| !perp(x3 - x4, y3 - y4, x1 - x4, y1 - y4)
				|| !perp(x4 - x1, y4 - y1, x2 - x1, y2 - y1)) {
			return false;
		}
		return true;
	}

	boolean ok2(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) {
		if (!ok1(x1, y1, x2, y2, x3, y3, x4, y4)) {
			return false;
		}
		long x = dist(x1, y1, x2, y2);
		if (x != dist(x2, y2, x3, y3) || x != dist(x3, y3, x4, y4)
				|| x != dist(x4, y4, x1, y1)) {
			return false;
		}
		return true;
	}

	void solve() throws IOException {
		for (int i = 0; i < 8; i++) {
			x[i] = nextInt();
			y[i] = nextInt();
		}
		boolean[] used = new boolean[8];
		for (int i1 = 0; i1 < 8; i1++) {
			used[i1] = true;
			for (int i2 = 0; i2 < 8; i2++) {
				if (used[i2]) {
					continue;
				}
				used[i2] = true;
				for (int i3 = 0; i3 < 8; i3++) {
					if (used[i3]) {
						continue;
					}
					used[i3] = true;
					for (int i4 = 0; i4 < 8; i4++) {
						if (used[i4]) {
							continue;
						}
						used[i4] = true;
						for (int i5 = 0; i5 < 8; i5++) {
							if (used[i5]) {
								continue;
							}
							used[i5] = true;
							for (int i6 = 0; i6 < 8; i6++) {
								if (used[i6]) {
									continue;
								}
								used[i6] = true;
								for (int i7 = 0; i7 < 8; i7++) {
									if (used[i7]) {
										continue;
									}
									used[i7] = true;
									for (int i8 = 0; i8 < 8; i8++) {
										if (used[i8]) {
											continue;
										}
										if (ok2(x[i1], y[i1], x[i2], y[i2],
												x[i3], y[i3], x[i4], y[i4])
												&& ok1(x[i5], y[i5], x[i6],
														y[i6], x[i7], y[i7],
														x[i8], y[i8])) {
											out.println("YES");
											out.print(i1 + 1);
											out.print(' ');
											out.print(i2 + 1);
											out.print(' ');
											out.print(i3 + 1);
											out.print(' ');
											out.print(i4 + 1);
											out.println();
											out.print(i5 + 1);
											out.print(' ');
											out.print(i6 + 1);
											out.print(' ');
											out.print(i7 + 1);
											out.print(' ');
											out.print(i8 + 1);
											return;
										}
									}
									used[i7] = false;
								}
								used[i6] = false;
							}
							used[i5] = false;
						}
						used[i4] = false;
					}
					used[i3] = false;
				}
				used[i2] = false;
			}
			used[i1] = false;
		}
		out.print("NO");
	}

	void run() throws IOException {
		// br = new BufferedReader(new FileReader("taskb.in"));
		// out = new PrintWriter("taskb.out");
		// br = new BufferedReader(new FileReader("input.txt"));
		// out = new PrintWriter("output.txt");
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		br.close();
		out.close();
	}

	public static void main(String[] args) throws IOException {
		// Locale.setDefault(Locale.US);
		new TaskB().run();
	}
}


import java.util.*;

public class taskD {

    public static void main(String[] args) {
        new taskD().main();
    }
    Scanner in = new Scanner(System.in);
    boolean ans = false;
    Set<Integer> sq = new HashSet<Integer>(), tempSq = new HashSet<Integer>();
    int x[] = new int[8], y[] = new int[8];

    int square(int x) {
        return x * x;
    }

    int dist(int i, int j) {
        return square(x[i] - x[j]) + square(y[i] - y[j]);
    }

    boolean isSquare(ArrayList<Integer> psq) {
        ArrayList<Integer> sides = new ArrayList<Integer>();
        for (int i = 0; i < 4; i++) {
            for (int j = i + 1; j < 4; j++) {
                sides.add(dist(psq.get(i), psq.get(j)));
            }
        }
        Collections.sort(sides);
        for (int i = 1; i <= 3; i++) {
            if (!sides.get(i).equals(sides.get(i - 1))) {
                return false;
            }
        }
        if (!sides.get(4).equals(sides.get(5))) {
            return false;
        }
        if (sides.get(0) == 0 || sides.get(4) == 0) {
            return false;
        }
        return true;
    }

    boolean isRect(ArrayList<Integer> prect) {
        ArrayList<Integer> sides = new ArrayList<Integer>();
        for (int i = 0; i < 4; i++) {
            for (int j = i + 1; j < 4; j++) {
                sides.add(dist(prect.get(i), prect.get(j)));
            }
        }
        Collections.sort(sides);
        for (int i = 0; i <= 2; i++) {
            if (!sides.get(2 * i).equals(sides.get(2 * i + 1))) {
                return false;
            }
        }
        if (sides.get(0) == 0 || sides.get(2) == 0 || sides.get(4) == 0) {
            return false;
        }

        return true;
    }

    void check() {
        if (ans) {
            return;
        }
        if (tempSq.size() == 4) {
            ArrayList<Integer> psq = new ArrayList<Integer>(),
                    prect = new ArrayList<Integer>();
            for (int i = 0; i < 8; i++) {
                if (tempSq.contains(i)) {
                    psq.add(i);
                } else {
                    prect.add(i);
                }
            }
            if (isSquare(psq) && isRect(prect)) {
                ans = true;
                for (int q : tempSq) {
                    sq.add(q);
                }
            }
        }
    }

    void rec(int num) {
        if (num == 8) {
            check();
            return;
        }
        rec(num + 1);
        tempSq.add(num);
        rec(num + 1);
        tempSq.remove(num);
    }

    void output() {
        if (ans) {
            System.out.println("YES");
            boolean was = false;
            for (int i = 0; i < 8; i++) {
                if (sq.contains(i)) {
                    if (was) {
                        System.out.print(' ');
                    } else {
                        was = true;
                    }
                    System.out.print(i+1);
                }
            }
            was = false;
            System.out.println();
            for (int i = 0; i < 8; i++) {
                if (!sq.contains(i)) {
                    if (was) {
                        System.out.print(' ');
                    } else {
                        was = true;
                    }
                    System.out.print(i+1);
                }
            }
            System.out.println();
        } else {
            System.out.println("NO");
        }
    }

    void main() {
        for (int i = 0; i < 8; i++) {
            x[i] = in.nextInt();
            y[i] = in.nextInt();
        }
        rec(0);
        output();
    }
}


import java.util.*;

public class taskD {

    class Point {

        int x, y;
        int _len2 = -1;

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

        int len2() {
            if (_len2 != -1) {
                return _len2;
            }
            _len2 = x*x + y*y;
            return _len2;
        }

        boolean angleIs90(Point other) {
            return x * other.x + y * other.y == 0;
        }
    }

    public static void main(String[] args) {
        new taskD().main();
    }
    Scanner in = new Scanner(System.in);
    ArrayList<Point> points = new ArrayList<Point>();
    ArrayList<Integer> res = new ArrayList<Integer>(), perm = new ArrayList<Integer>();
    boolean[] used = new boolean[8];
    int usedc = 0;

    void input() {
        for (int i = 0; i < 8; i++) {
            points.add(new Point(in.nextInt(), in.nextInt()));
            used[i] = false;
        }
    }

    boolean isSquare(Point A, Point B, Point C, Point D) {
        Point AB = new Point(A.x - B.x, A.y - B.y),
                BC = new Point(B.x - C.x, B.y - C.y),
                CD = new Point(C.x - D.x, C.y - D.y),
                DA = new Point(D.x - A.x, D.y - A.y);
        return AB.len2() == BC.len2() && BC.len2() == CD.len2() && CD.len2() == DA.len2()
                && AB.angleIs90(BC) && BC.angleIs90(CD) && CD.angleIs90(DA);
    }

    boolean isRect(Point A, Point B, Point C, Point D) {
        Point AB = new Point(A.x - B.x, A.y - B.y),
                BC = new Point(B.x - C.x, B.y - C.y),
                CD = new Point(C.x - D.x, C.y - D.y),
                DA = new Point(D.x - A.x, D.y - A.y);
        return AB.len2() == CD.len2() && BC.len2() == DA.len2()
                && AB.angleIs90(BC) && BC.angleIs90(CD) && CD.angleIs90(DA);
    }

    void check() {
        if (res.size() > 0) {
            return;
        }
        if (isSquare(points.get(perm.get(0)),
                points.get(perm.get(1)),
                points.get(perm.get(2)),
                points.get(perm.get(3)))
                && isRect(points.get(perm.get(4)), points.get(perm.get(5)), points.get(perm.get(6)),
                points.get(perm.get(7)))) {
            for (int x : perm) {
                res.add(x);
            }
        }
        if (isSquare(points.get(perm.get(0)),
                points.get(perm.get(1)),
                points.get(perm.get(2)),
                points.get(perm.get(3)))
                && isRect(points.get(perm.get(4)), points.get(perm.get(5)), points.get(perm.get(6)),
                points.get(perm.get(7)))) {
            System.out.println(" ");
        }
    }

    void solve() {
        if (usedc == 8) {
            check();
        } else {
            for (int i = 0; i < 8; i++) {
                if (!used[i]) {
                    used[i] = true;
                    usedc++;
                    perm.add(i);
                    solve();
                    perm.remove(perm.size() - 1);
                    usedc--;
                    used[i] = false;
                }
            }
        }
    }

    void output() {
        if (res.size() > 0) {
            System.out.println("YES");
            for (int i = 0; i < 8; i++) {
                System.out.print(res.get(i) + 1);
                System.out.print(i % 4 == 3 ? '\n' : ' ');
            }
        } else {
            System.out.println("NO");
        }
    }

    void main() {
        input();
        solve();
        output();
    }
}


import java.util.*;

public class taskD {

    public static void main(String[] args) {
        new taskD().main();
    }
    Scanner in = new Scanner(System.in);
    boolean ans = false;
    Set<Integer> sq = new HashSet<Integer>(), tempSq = new HashSet<Integer>();
    int x[] = new int[8], y[] = new int[8];

    int square(int x) {
        return x * x;
    }

    int dist(int i, int j) {
        return square(x[i] - x[j]) + square(y[i] - y[j]);
    }

    boolean isSquare(ArrayList<Integer> psq) {
        ArrayList<Integer> sides = new ArrayList<Integer>();
        for (int i = 0; i < 4; i++) {
            for (int j = i + 1; j < 4; j++) {
                sides.add(dist(psq.get(i), psq.get(j)));
            }
        }
        Collections.sort(sides);
        for (int i = 1; i <= 3; i++) {
            if (!sides.get(i).equals(sides.get(i - 1))) {
                return false;
            }
        }
        if (!sides.get(4).equals(sides.get(5))) {
            return false;
        }
        if (sides.get(0) == 0 || sides.get(4) == 0) {
            return false;
        }
        if (sides.get(0) + sides.get(2) != sides.get(4)) {
            return false;
        }
        return true;
    }

    boolean isRect(ArrayList<Integer> prect) {
        ArrayList<Integer> sides = new ArrayList<Integer>();
        for (int i = 0; i < 4; i++) {
            for (int j = i + 1; j < 4; j++) {
                sides.add(dist(prect.get(i), prect.get(j)));
            }
        }
        Collections.sort(sides);
        for (int i = 0; i <= 2; i++) {
            if (!sides.get(2 * i).equals(sides.get(2 * i + 1))) {
                return false;
            }
        }
        if (sides.get(0) == 0 || sides.get(2) == 0 || sides.get(4) == 0) {
            return false;
        }

        if (sides.get(0) + sides.get(2) != sides.get(4)) {
            return false;
        }

        return true;
    }

    void check() {
        if (ans) {
            return;
        }
        if (tempSq.size() == 4) {
            ArrayList<Integer> psq = new ArrayList<Integer>(),
                    prect = new ArrayList<Integer>();
            for (int i = 0; i < 8; i++) {
                if (tempSq.contains(i)) {
                    psq.add(i);
                } else {
                    prect.add(i);
                }
            }
            if (isSquare(psq) && isRect(prect)) {
                ans = true;
                for (int q : tempSq) {
                    sq.add(q);
                }
            }
        }
    }

    void rec(int num) {
        if (num == 8) {
            check();
            return;
        }
        rec(num + 1);
        tempSq.add(num);
        rec(num + 1);
        tempSq.remove(num);
    }

    void output() {
        if (ans) {
            System.out.println("YES");
            boolean was = false;
            for (int i = 0; i < 8; i++) {
                if (sq.contains(i)) {
                    if (was) {
                        System.out.print(' ');
                    } else {
                        was = true;
                    }
                    System.out.print(i+1);
                }
            }
            was = false;
            System.out.println();
            for (int i = 0; i < 8; i++) {
                if (!sq.contains(i)) {
                    if (was) {
                        System.out.print(' ');
                    } else {
                        was = true;
                    }
                    System.out.print(i+1);
                }
            }
            System.out.println();
        } else {
            System.out.println("NO");
        }
    }

    void main() {
        for (int i = 0; i < 8; i++) {
            x[i] = in.nextInt();
            y[i] = in.nextInt();
        }
        rec(0);
        output();
    }
}


import java.util.*;

public class taskD {

    public static void main(String[] args) {
        new taskD().main();
    }
    Scanner in = new Scanner(System.in);
    boolean ans = false;
    Set<Integer> sq = new HashSet<Integer>(), tempSq = new HashSet<Integer>();
    int x[] = new int[8], y[] = new int[8];

    int square(int x) {
        return x * x;
    }

    int dist(int i, int j) {
        return square(x[i] - x[j]) + square(y[i] - y[j]);
    }

    boolean isSquare(ArrayList<Integer> psq) {
        ArrayList<Integer> sides = new ArrayList<Integer>();
        for (int i = 0; i < 4; i++) {
            for (int j = i + 1; j < 4; j++) {
                sides.add(dist(psq.get(i), psq.get(j)));
            }
        }
        Collections.sort(sides);
        for (int i = 1; i <= 3; i++) {
            if (!sides.get(i).equals(sides.get(i - 1))) {
                return false;
            }
        }
        if (!sides.get(4).equals(sides.get(5))) {
            return false;
        }
        if (sides.get(0) == 0 || sides.get(4) == 0) {
            return false;
        }
        return true;
    }

    boolean isRect(ArrayList<Integer> prect) {
        ArrayList<Integer> sides = new ArrayList<Integer>();
        for (int i = 0; i < 4; i++) {
            for (int j = i + 1; j < 4; j++) {
                sides.add(dist(prect.get(i), prect.get(j)));
            }
        }
        Collections.sort(sides);
        for (int i = 0; i <= 2; i++) {
            if (!sides.get(2 * i).equals(sides.get(2 * i + 1))) {
                return false;
            }
        }
        if (sides.get(0) == 0 || sides.get(2) == 0 || sides.get(4) == 0) {
            return false;
        }

        if (sides.get(0) + sides.get(2) != sides.get(4)) {
            return false;
        }

        return true;
    }

    void check() {
        if (ans) {
            return;
        }
        if (tempSq.size() == 4) {
            ArrayList<Integer> psq = new ArrayList<Integer>(),
                    prect = new ArrayList<Integer>();
            for (int i = 0; i < 8; i++) {
                if (tempSq.contains(i)) {
                    psq.add(i);
                } else {
                    prect.add(i);
                }
            }
            if (isSquare(psq) && isRect(prect)) {
                ans = true;
                for (int q : tempSq) {
                    sq.add(q);
                }
            }
        }
    }

    void rec(int num) {
        if (num == 8) {
            check();
            return;
        }
        rec(num + 1);
        tempSq.add(num);
        rec(num + 1);
        tempSq.remove(num);
    }

    void output() {
        if (ans) {
            System.out.println("YES");
            boolean was = false;
            for (int i = 0; i < 8; i++) {
                if (sq.contains(i)) {
                    if (was) {
                        System.out.print(' ');
                    } else {
                        was = true;
                    }
                    System.out.print(i+1);
                }
            }
            was = false;
            System.out.println();
            for (int i = 0; i < 8; i++) {
                if (!sq.contains(i)) {
                    if (was) {
                        System.out.print(' ');
                    } else {
                        was = true;
                    }
                    System.out.print(i+1);
                }
            }
            System.out.println();
        } else {
            System.out.println("NO");
        }
    }

    void main() {
        for (int i = 0; i < 8; i++) {
            x[i] = in.nextInt();
            y[i] = in.nextInt();
        }
        rec(0);
        output();
    }
}


import java.util.*;

public class taskD {

    class Point {

        int x, y;
        int _len2 = -1;

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

        int len2() {
            if (_len2 != -1) {
                return _len2;
            }
            _len2 = x*x + y*y;
            return _len2;
        }

        boolean angleIs90(Point other) {
            return x * other.x + y * other.y == 0;
        }
    }

    public static void main(String[] args) {
        new taskD().main();
    }
    Scanner in = new Scanner(System.in);
    ArrayList<Point> points = new ArrayList<Point>();
    ArrayList<Integer> res = new ArrayList<Integer>(), perm = new ArrayList<Integer>();
    boolean[] used = new boolean[8];
    int usedc = 0;

    void input() {
        for (int i = 0; i < 8; i++) {
            points.add(new Point(in.nextInt(), in.nextInt()));
            used[i] = false;
        }
    }

    boolean isSquare(Point A, Point B, Point C, Point D) {
        Point AB = new Point(A.x - B.x, A.y - B.y),
                BC = new Point(B.x - C.x, B.y - C.y),
                CD = new Point(C.x - D.x, C.y - D.y),
                DA = new Point(D.x - A.x, D.y - A.y);
        return AB.len2() == BC.len2() && BC.len2() == CD.len2() && CD.len2() == DA.len2()
                && AB.angleIs90(BC) && BC.angleIs90(CD) && CD.angleIs90(DA);
    }

    boolean isRect(Point A, Point B, Point C, Point D) {
        Point AB = new Point(A.x - B.x, A.y - B.y),
                BC = new Point(B.x - C.x, B.y - C.y),
                CD = new Point(C.x - D.x, C.y - D.y),
                DA = new Point(D.x - A.x, D.y - A.y);
        return AB.len2() == CD.len2() && BC.len2() == DA.len2()
                && AB.angleIs90(BC) && BC.angleIs90(CD) && CD.angleIs90(DA);
    }

    void check() {
        if (res.size() > 0) {
            return;
        }
        if (isSquare(points.get(perm.get(0)),
                points.get(perm.get(1)),
                points.get(perm.get(2)),
                points.get(perm.get(3)))
                && isRect(points.get(perm.get(4)), points.get(perm.get(5)), points.get(perm.get(6)),
                points.get(perm.get(7)))) {
            for (int x : perm) {
                res.add(x);
            }
        }
    }

    void solve() {
        if (usedc == 8) {
            check();
        } else {
            for (int i = 0; i < 8; i++) {
                if (!used[i]) {
                    used[i] = true;
                    usedc++;
                    perm.add(i);
                    solve();
                    perm.remove(perm.size() - 1);
                    usedc--;
                    used[i] = false;
                }
            }
        }
    }

    void output() {
        if (res.size() > 0) {
            System.out.println("YES");
            for (int i = 0; i < 8; i++) {
                System.out.print(res.get(i) + 1);
                System.out.print(i % 4 == 3 ? '\n' : ' ');
            }
        } else {
            System.out.println("NO");
        }
    }

    void main() {
        input();
        solve();
        output();
    }
}


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Saransh
 */
import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;

public class Main {

    /**
     * @param args the command line arguments
     */
    static int arr[][] = new int[8][2];

    public static void main(String[] args) {
        // TODO code application logic here
        try {
            Parserdoubt pd = new Parserdoubt(System.in);
            PrintWriter pw = new PrintWriter(System.out);
            for (int i = 0; i < arr.length; i++) {
                arr[i][0] = pd.nextInt();
                arr[i][1] = pd.nextInt();
            }
            for (int i = 0; i < (1 << 8); i++)
            {
                //System.out.println(i);
                if (Integer.bitCount(i) == 4)
                {
                    boolean k = check(i);
                    if(k)
                    {
                        System.out.println("YES");
                        int tmpi=i;
                        for(int j=1;j<=8;j++)
                        {
                            if(i%2==1)
                                System.out.print(j+" ");
                            i/=2;
                        }
                        System.out.println();
                        for(int j=1;j<=8;j++)
                        {
                            if(tmpi%2==0)
                                System.out.print(j+" ");
                            tmpi/=2;
                        }
                        return;
                    }
                }
            }
            System.out.println("NO");
        } catch (Exception e)
        {
            e.printStackTrace();
        }

    }
    static int arr2[][];
    public static boolean check(int a)
    {
        int arr1[][]=new int[4][2];
        arr2=new int[4][2];
        int c1=0;
        int c2=0;
        for(int i=0;i<8;i++)
        {
            if(a%2==0)
            {
                arr1[c1][0]=arr[i][0];
                arr1[c1][1]=arr[i][1];
                c1++;
            }
            else
            {
                arr2[c2][0]=arr[i][0];
                arr2[c2][1]=arr[i][1];
                c2++;

            }a/=2;
        }
        if(isRectangle(arr1[0][0],arr1[0][1],arr1[1][0],arr1[1][1],arr1[2][0],arr1[2][1],arr1[3][0],arr1[3][1]))
        {
            if(isRectangle(arr2[0][0],arr2[0][1],arr2[1][0],arr2[1][1],arr2[2][0],arr2[2][1],arr2[3][0],arr2[3][1]))
            {
                if(check(0,2,3,1)||check(0,1,2,3)||check(0,1,3,2))
                {
                    return true;
                }
            }
        }
        return false;
    }
    public static boolean check(int a,int b,int c,int d)
    {
        if(eq(a,b,a,c)&&eq(a,b,c,d))
            return true;
        return false;
    }
    public static boolean eq(int a,int b,int c,int d)
    {
        if(Math.abs(dist(a,b)-dist(c,d))<1e-8)
            return true;
        return false;
    }
    public static double dist(int a,int b)
    {
        double x=arr2[a][0]-arr2[b][0];
        double y=arr2[a][1]-arr2[b][1];
        return Math.sqrt(x*x+y*y);
    }
    public static boolean isRectangle(double x1, double y1,
            double x2, double y2,
            double x3, double y3,
            double x4, double y4)
    {
        double cx, cy;
        double dd1, dd2, dd3, dd4;

        cx = (x1 + x2 + x3 + x4) / 4;
        cy = (y1 + y2 + y3 + y4) / 4;

        dd1 = sqr(cx - x1) + sqr(cy - y1);
        dd2 = sqr(cx - x2) + sqr(cy - y2);
        dd3 = sqr(cx - x3) + sqr(cy - y3);
        dd4 = sqr(cx - x4) + sqr(cy - y4);
        return dd1 == dd2 && dd1 == dd3 && dd1 == dd4;
    }
    public static double sqr(double a)
    {
        return a*a;
    }
}

class Parserdoubt {

    final private int BUFFER_SIZE = 1 << 17;
    private DataInputStream din;
    private byte[] buffer;
    private int bufferPointer, bytesRead;

    public Parserdoubt(InputStream in) {
        din = new DataInputStream(in);
        buffer = new byte[BUFFER_SIZE];
        bufferPointer = bytesRead = 0;
    }

    public String nextString() throws Exception {
        StringBuffer sb = new StringBuffer("");
        byte c = read();
        while (c <= ' ') {
            c = read();
        }
        do {
            sb.append((char) c);
            c = read();
        } while (c > ' ');
        return sb.toString();
    }

    public char nextChar() throws Exception {
        byte c = read();
        while (c <= ' ') {
            c = read();
        }
        return (char) c;
    }

    public int nextInt() throws Exception {
        int ret = 0;
        byte c = read();
        while (c <= ' ') {
            c = read();
        }
        boolean neg = c == '-';
        if (neg) {
            c = read();
        }
        do {
            ret = ret * 10 + c - '0';
            c = read();
        } while (c > ' ');
        if (neg) {
            return -ret;
        }
        return ret;
    }

    public long nextLong() throws Exception {
        long ret = 0;
        byte c = read();
        while (c <= ' ') {
            c = read();
        }
        boolean neg = c == '-';
        if (neg) {
            c = read();
        }
        do {
            ret = ret * 10 + c - '0';
            c = read();
        } while (c > ' ');
        if (neg) {
            return -ret;
        }
        return ret;
    }

    private void fillBuffer() throws Exception {
        bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
        if (bytesRead == -1) {
            buffer[0] = -1;
        }
    }

    private byte read() throws Exception {
        if (bufferPointer == bytesRead) {
            fillBuffer();
        }
        return buffer[bufferPointer++];
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

public class ProblemD {

    public static int[][] points;

    public static int INVALID = -1000000;

    public static int isrect(int[] a) {
        int ax = points[a[0]][0];
        int ay = points[a[0]][1];
        for (int bidx = 1; bidx < 4 ; bidx++) {
            int bx = points[a[bidx]][0];
            int by = points[a[bidx]][1];
            int cx = INVALID, cy = INVALID;
            int dx = INVALID, dy = INVALID;
            for (int b = 1 ; b < 4 ; b++) {
                if (b == bidx) {
                    continue;
                }
                if (cx == INVALID) {
                    cx = points[a[b]][0];
                    cy = points[a[b]][1];
                    continue;
                }
                if (dx == INVALID) {
                    dx = points[a[b]][0];
                    dy = points[a[b]][1];
                    continue;
                }
            }

//          System.out.println(ax + "," + ay);
//          System.out.println(bx + "," + by);
//          System.out.println(cx + "," + cy);
//          System.out.println(dx + "," + dy);
//          System.out.println();

            int acx = cx - ax;
            int acy = cy - ay;
            int adx = dx - ax;
            int ady = dy - ay;
            int bcx = cx - bx;
            int bcy = cy - by;
            int bdx = dx - bx;
            int bdy = dy - by;

            if ((acx * ady - adx * acy) != 0) {
                if (acx * adx + acy * ady == 0) {
                    if (bcx * bdx + bcy * bdy == 0) {
                        return 2;
                    }
                }
                return 1;
            }
        }
        return -1;
    }

    public static boolean printarray(int[] a) {
        for (int i = 0 ; i < a.length - 1 ; i++) {
            System.out.print((a[i] + 1) + " ");
        }
        System.out.print(a[a.length-1] + 1);
        System.out.println();

        return false;
    }

    public static void main(String[] args) throws IOException {
        BufferedReader s = new BufferedReader(new InputStreamReader(System.in));

        points = new int[8][2];
        for (int i = 0 ; i < 8 ; i++) {
            String[] info = s.readLine().split(" ");
            points[i][0] = Integer.valueOf(info[0]);
            points[i][1] = Integer.valueOf(info[1]);
        }

//      System.out.println(isrect(new int[]{4,5,6,7}));

        for (int i = 0 ; i < (1<<8) ; i++) {
            if (Integer.bitCount(i) == 4) {
                int[] a = new int[4];
                int[] b = new int[4];
                int aidx = 0;
                int bidx = 0;
                for (int j = 0 ; j < 8 ; j++) {
                    if ((i & (1 << j)) >= 1) {
                        a[aidx++] = j;
                    } else {
                        b[bidx++] = j;
                    }
                }
                if (isrect(a) >=  1 && isrect(b) >= 2) {
                    System.out.println("YES");
                    printarray(b);
                    printarray(a);
                    return;
                }
            }
        }

        System.out.println("NO");
    }
}


// バルス！

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

public class ProblemD {

    public static int[][] points;

    public static int INVALID = -1000000;

    public static boolean isrect(int[] a) {
        int ax = points[a[0]][0];
        int ay = points[a[0]][1];
        for (int bidx = 1; bidx < 4 ; bidx++) {
            int bx = points[a[bidx]][0];
            int by = points[a[bidx]][1];
            int cx = INVALID, cy = INVALID;
            int dx = INVALID, dy = INVALID;
            for (int b = 1 ; b < 4 ; b++) {
                if (b == bidx) {
                    continue;
                }
                if (cx == INVALID) {
                    cx = points[a[b]][0];
                    cy = points[a[b]][1];
                    continue;
                }
                if (dx == INVALID) {
                    dx = points[a[b]][0];
                    dy = points[a[b]][1];
                    continue;
                }
            }

//          System.out.println(ax + "," + ay);
//          System.out.println(bx + "," + by);
//          System.out.println(cx + "," + cy);
//          System.out.println(dx + "," + dy);
//          System.out.println();

            int acx = cx - ax;
            int acy = cy - ay;
            int adx = dx - ax;
            int ady = dy - ay;
            int bcx = cx - bx;
            int bcy = cy - by;
            int bdx = dx - bx;
            int bdy = dy - by;

            if (acx * adx + acy * ady == 0) {
                if (bcx * bdx + bcy * bdy == 0) {
                    if ((acx * ady - adx * acy) != 0) {
                        return true;
                    }
                }
            }
        }
        return false;
    }

    public static boolean printarray(int[] a) {
        for (int i = 0 ; i < a.length - 1 ; i++) {
            System.out.print((a[i] + 1) + " ");
        }
        System.out.print(a[a.length-1] + 1);
        System.out.println();

        return false;
    }

    public static void main(String[] args) throws IOException {
        BufferedReader s = new BufferedReader(new InputStreamReader(System.in));

        points = new int[8][2];
        for (int i = 0 ; i < 8 ; i++) {
            String[] info = s.readLine().split(" ");
            points[i][0] = Integer.valueOf(info[0]);
            points[i][1] = Integer.valueOf(info[1]);
        }

//      System.out.println(isrect(new int[]{4,5,6,7}));

        for (int i = 0 ; i < (1<<8) ; i++) {
            if (Integer.bitCount(i) == 4) {
                int[] a = new int[4];
                int[] b = new int[4];
                int aidx = 0;
                int bidx = 0;
                for (int j = 0 ; j < 8 ; j++) {
                    if ((i & (1 << j)) >= 1) {
                        a[aidx++] = j;
                    } else {
                        b[bidx++] = j;
                    }
                }
                if (isrect(a) && isrect(b)) {
                    System.out.println("YES");
                    printarray(a);
                    printarray(b);
                    return;
                }
            }
        }

        System.out.println("NO");
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

public class ProblemD {

    public static int[][] points;

    public static int INVALID = -1000000;

    public static int isrect(int[] a) {
        int ax = points[a[0]][0];
        int ay = points[a[0]][1];

        int maxdist = 0;
        int maxbidx = 0;
        for (int bidx = 1; bidx < 4 ; bidx++) {
            int bx = points[a[bidx]][0];
            int by = points[a[bidx]][1];
            int dist = (ax-bx)*(ax-bx)+(ay-by)*(ay-by);
            if (maxdist < dist) {
                maxdist = dist;
                maxbidx = bidx;
            }
        }
        if (maxbidx == 0) {
            return -1;
        }

        int bidx = maxbidx;
        int bx = points[a[bidx]][0];
        int by = points[a[bidx]][1];
        int cx = INVALID, cy = INVALID;
        int dx = INVALID, dy = INVALID;
        for (int b = 1 ; b < 4 ; b++) {
            if (b == bidx) {
                continue;
            }
            if (cx == INVALID) {
                cx = points[a[b]][0];
                cy = points[a[b]][1];
                continue;
            }
            if (dx == INVALID) {
                dx = points[a[b]][0];
                dy = points[a[b]][1];
                continue;
            }
        }

        int acx = cx - ax;
        int acy = cy - ay;
        int adx = dx - ax;
        int ady = dy - ay;
        int bcx = cx - bx;
        int bcy = cy - by;
        int bdx = dx - bx;
        int bdy = dy - by;

        if ((acx * ady - adx * acy) != 0) {
            if (acx * adx + acy * ady == 0) {
                if (bcx * bdx + bcy * bdy == 0) {
                    int acac = acx*acx + acy*acy;
                    int adad = adx*adx + ady*ady;
                    int bcbc = bcx*bcx + bcy*bcy;
                    int bdbd = bdx*bdx + bdy*bdy;
                    int min = acac;
                    int max = acac;
                    min = Math.min(min, adad);
                    min = Math.min(min, bcbc);
                    min = Math.min(min, bdbd);
                    max = Math.max(max, adad);
                    max = Math.max(max, bcbc);
                    max = Math.max(max, bdbd);
                    if (min == max) {
                        return 2;
                    }
                    return 1;
                }
            }
        }
        return -1;
    }

    public static boolean printarray(int[] a) {
        for (int i = 0 ; i < a.length - 1 ; i++) {
            System.out.print((a[i] + 1) + " ");
        }
        System.out.print(a[a.length-1] + 1);
        System.out.println();

        return false;
    }

    public static void main(String[] args) throws IOException {
        BufferedReader s = new BufferedReader(new InputStreamReader(System.in));

        points = new int[8][2];
        for (int i = 0 ; i < 8 ; i++) {
            String[] info = s.readLine().split(" ");
            points[i][0] = Integer.valueOf(info[0]);
            points[i][1] = Integer.valueOf(info[1]);
        }

//      System.out.println(isrect(new int[]{4,5,6,7}));

        for (int i = 0 ; i < (1<<8) ; i++) {
            if (Integer.bitCount(i) == 4) {
                int[] a = new int[4];
                int[] b = new int[4];
                int aidx = 0;
                int bidx = 0;
                for (int j = 0 ; j < 8 ; j++) {
                    if ((i & (1 << j)) >= 1) {
                        a[aidx++] = j;
                    } else {
                        b[bidx++] = j;
                    }
                }
                if (isrect(a) >=  2 && isrect(b) >= 1) {
                    System.out.println("YES");
                    printarray(a);
                    printarray(b);
                    return;
                }
            }
        }

        System.out.println("NO");
    }
}


// バルス！

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

public class ProblemD {

    public static int[][] points;

    public static int INVALID = -1000000;

    public static int isrect(int[] a) {
        int ax = points[a[0]][0];
        int ay = points[a[0]][1];
        for (int bidx = 1; bidx < 4 ; bidx++) {
            int bx = points[a[bidx]][0];
            int by = points[a[bidx]][1];
            int cx = INVALID, cy = INVALID;
            int dx = INVALID, dy = INVALID;
            for (int b = 1 ; b < 4 ; b++) {
                if (b == bidx) {
                    continue;
                }
                if (cx == INVALID) {
                    cx = points[a[b]][0];
                    cy = points[a[b]][1];
                    continue;
                }
                if (dx == INVALID) {
                    dx = points[a[b]][0];
                    dy = points[a[b]][1];
                    continue;
                }
            }

//          System.out.println(ax + "," + ay);
//          System.out.println(bx + "," + by);
//          System.out.println(cx + "," + cy);
//          System.out.println(dx + "," + dy);
//          System.out.println();

            int acx = cx - ax;
            int acy = cy - ay;
            int adx = dx - ax;
            int ady = dy - ay;
            int bcx = cx - bx;
            int bcy = cy - by;
            int bdx = dx - bx;
            int bdy = dy - by;

            if ((acx * ady - adx * acy) != 0) {
                if (acx * adx + acy * ady == 0) {
                    if (bcx * bdx + bcy * bdy == 0) {
                        int acac = acx*acx + acy*acy;
                        int adad = adx*adx + ady*ady;
                        int bcbc = bcx*bcx + bcy*bcy;
                        int bdbd = bdx*bdx + bdy*bdy;
                        int min = acac;
                        int max = acac;
                        min = Math.min(min, adad);
                        min = Math.min(min, bcbc);
                        min = Math.min(min, bdbd);
                        max = Math.max(max, adad);
                        max = Math.max(max, bcbc);
                        max = Math.max(max, bdbd);
                        if (min == max) {
                            return 2;
                        }
                        return 1;
                    }
                }
                return 1;
            }
        }
        return -1;
    }

    public static boolean printarray(int[] a) {
        for (int i = 0 ; i < a.length - 1 ; i++) {
            System.out.print((a[i] + 1) + " ");
        }
        System.out.print(a[a.length-1] + 1);
        System.out.println();

        return false;
    }

    public static void main(String[] args) throws IOException {
        BufferedReader s = new BufferedReader(new InputStreamReader(System.in));

        points = new int[8][2];
        for (int i = 0 ; i < 8 ; i++) {
            String[] info = s.readLine().split(" ");
            points[i][0] = Integer.valueOf(info[0]);
            points[i][1] = Integer.valueOf(info[1]);
        }

//      System.out.println(isrect(new int[]{4,5,6,7}));

        for (int i = 0 ; i < (1<<8) ; i++) {
            if (Integer.bitCount(i) == 4) {
                int[] a = new int[4];
                int[] b = new int[4];
                int aidx = 0;
                int bidx = 0;
                for (int j = 0 ; j < 8 ; j++) {
                    if ((i & (1 << j)) >= 1) {
                        a[aidx++] = j;
                    } else {
                        b[bidx++] = j;
                    }
                }
                if (isrect(a) >=  2 && isrect(b) >= 1) {
                    System.out.println("YES");
                    printarray(a);
                    printarray(b);
                    return;
                }
            }
        }

        System.out.println("NO");
    }
}


import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class D {

    class Point {

        int idx;
        long x, y;

        Point(int idx, long x, long y) {
            this.idx = idx;
            this.x = x;
            this.y = y;
        }
    }

    int ccw(Point A, Point B, Point C) {
        long dx1 = B.x - A.x, dy1 = B.y - A.y;
        long dx2 = C.x - A.x, dy2 = C.y - A.y;
        return Long.signum(dx1 * dy2 - dx2 * dy1);
    }

    Point[] sort(Point[] a) {
        int imin = 0;
        for (int i = 0; i < 4; ++i) {
            if (a[i].y < a[imin].y || (a[i].y == a[imin].y && a[i].x < a[imin].x)) {
                imin = i;
            }
        }
        final Point O = new Point(a[imin].idx, a[imin].x, a[imin].y);
        Arrays.sort(a, new Comparator<Point>() {

            @Override
            public int compare(Point A, Point B) {
                int c = ccw(O, A, B);
                if (c != 0) {
                    return -c;
                }
                return Long.signum(sqr(A.x - O.x) + sqr(A.y - O.y) - sqr(B.x - O.x) - sqr(B.y - O.y));
            }
        });
        return a;
    }

    boolean isPerpendicular(Point A, Point B, Point C) {
        long x1 = A.x - B.x, y1 = A.y - B.y;
        long x2 = C.x - B.x, y2 = C.y - B.y;
        return x1 * x2 + y1 * y2 == 0;
    }

    long sqr(long x) {
        return x * x;
    }

    boolean isRectangle(Point[] a) {
        a = sort(a);
        for (int i = 0; i < 4; ++i) {
            if (!isPerpendicular(a[i], a[(i + 1) % 4], a[(i + 2) % 4])) {
                return false;
            }
        }
        return true;
    }

    boolean isSquare(Point[] a) {
        a = sort(a);

        if (!isRectangle(a)) {
            return false;
        }

        long side = sqr(a[0].x - a[1].x) + sqr(a[0].y - a[1].y);
        for (int i = 0; i < 4; ++i) {
            long now = sqr(a[i].x - a[(i + 1) % 4].x) + sqr(a[i].y - a[(i + 1) % 4].y);
            if (now != side) {
                return false;
            }
        }

        return true;
    }

    public void run() {
        Scanner scanner = new Scanner(System.in);

        Point[] a = new Point[8];
        long x, y;
        for (int i = 0; i < 8; ++i) {
            x = scanner.nextLong();
            y = scanner.nextLong();
            a[i] = new Point(i + 1, x, y);
        }

        boolean found = false;
        for (int state = 0; state < (1 << 8); ++state) {
            if (Integer.bitCount(state) == 4) {
                Point[] square = new Point[4];
                Point[] rectangle = new Point[4];

                int ns = 0, nr = 0;
                for (int i = 0; i < 8; ++i) {
                    if (((state >> i) & 1) == 1) {
                        square[ns++] = new Point(a[i].idx, a[i].x, a[i].y);
                    } else {
                        rectangle[nr++] = new Point(a[i].idx, a[i].x, a[i].y);
                    }
                }

                if (isSquare(square) && isRectangle(rectangle)) {
                    found = true;
                    System.out.println("YES");
                    for (int i = 0; i < 4; ++i) {
                        System.out.print(square[i].idx + " ");
                    }
                    System.out.println();
                    for (int i = 0; i < 4; ++i) {
                        System.out.print(rectangle[i].idx + " ");
                    }
                    System.out.println();
                    break;
                }
            }
        }
        if (!found) {
            System.out.println("NO");
        }

        scanner.close();
    }

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


import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class D {

    class Point {

        int idx, x, y;

        Point(int idx, int x, int y) {
            this.idx = idx;
            this.x = x;
            this.y = y;
        }
    }

    int ccw(Point A, Point B, Point C) {
        long dx1 = B.x - A.x, dy1 = B.y - A.y;
        long dx2 = C.x - A.x, dy2 = C.y - A.y;
        return Long.signum(dx1 * dy2 - dx2 * dy1);
    }

    Point[] sort(Point[] a) {
        int imin = 0;
        for (int i = 0; i < 4; ++i) {
            if (a[i].y < a[imin].y || (a[i].y == a[imin].y && a[i].x < a[imin].x)) {
                imin = i;
            }
        }
        final Point O = new Point(a[imin].idx, a[imin].x, a[imin].y);
        Arrays.sort(a, new Comparator<Point>() {

            @Override
            public int compare(Point A, Point B) {
                return ccw(O, A, B);
            }
        });
        return a;
    }

    boolean isPerpendicular(Point A, Point B, Point C) {
        long x1 = A.x - B.x, y1 = A.y - B.y;
        long x2 = C.x - B.x, y2 = C.y - B.y;
        return x1 * x2 + y1 * y2 == 0;
    }

    long sqr(long x) {
        return x * x;
    }

    boolean isRectangle(Point[] a) {
        a = sort(a);
        for (int i = 0; i < 4; ++i) {
            if (!isPerpendicular(a[i], a[(i + 1) % 4], a[(i + 2) % 4])) {
                return false;
            }
        }
        return true;
    }

    boolean isSquare(Point[] a) {
        a = sort(a);

        if (!isRectangle(a)) {
            return false;
        }

        long side = sqr(a[0].x - a[1].x) + sqr(a[0].y - a[1].y);
        for (int i = 0; i < 4; ++i) {
            long now = sqr(a[i].x - a[(i + 1) % 4].x) + sqr(a[i].y - a[(i + 1) % 4].y);
            if (now != side) {
                return false;
            }
        }

        return true;
    }

    public void run() {
        Scanner scanner = new Scanner(System.in);

        Point[] a = new Point[8];
        for (int x, y, i = 0; i < 8; ++i) {
            x = scanner.nextInt();
            y = scanner.nextInt();
            a[i] = new Point(i + 1, x, y);
        }

        boolean found = false;
        for (int state = 0; state < (1 << 8); ++state) {
            if (Integer.bitCount(state) == 4) {
                Point[] square = new Point[4];
                Point[] rectangle = new Point[4];

                int ns = 0, nr = 0;
                for (int i = 0; i < 8; ++i) {
                    if (((state >> i) & 1) == 1) {
                        square[ns++] = new Point(a[i].idx, a[i].x, a[i].y);
                    } else {
                        rectangle[nr++] = new Point(a[i].idx, a[i].x, a[i].y);
                    }
                }

                if (isSquare(square) && isRectangle(rectangle)) {
                    found = true;
                    System.out.println("YES");
                    for (int i = 0; i < 4; ++i) {
                        System.out.print(square[i].idx + " ");
                    }
                    System.out.println();
                    for (int i = 0; i < 4; ++i) {
                        System.out.print(rectangle[i].idx + " ");
                    }
                    System.out.println();
                    break;
                }
            }
        }
        if (!found) {
            System.out.println("NO");
        }

        scanner.close();
    }

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


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

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner in = new Scanner(System.in);
        //Scanner in = new Scanner(new FileReader("Input.txt"));
        PrintWriter out = new PrintWriter(System.out);
        int n = 8;
        Point[] points = new Point[8];
        for (int i = 0; i< n; ++i) {
            points[i] = new Point(i + 1, in.nextInt(), in.nextInt());
        }

        boolean possible = false;
        for (int mask = (1 << 7); mask < (1 << 8); ++mask) {
            if (Integer.bitCount(mask) == 4) {
                ArrayList<Point> firstSet = new ArrayList<Point>();
                ArrayList<Point> secondSet = new ArrayList<Point>();
                for (int i = 0; i < n; ++i) {
                    if ((mask & (1 << i)) == 0)
                        secondSet.add(points[i]);
                    else
                        firstSet.add(points[i]);
                }
                int first = 0, second = 0;

                for (int w = 0; w < 4; ++w) {
                    for (int x = 0; x < 4; ++x) {
                        if (x == w) continue;
                        for (int y = 0; y < 4; ++y) {
                            if (y == w || y == x) continue;
                            for (int z = 0; z < 4; ++z) {
                                if (z == w || z == y || z == x) continue;
                                Point midPointDiagonal1 = new Point(-1, firstSet.get(w).x + firstSet.get(y).x, firstSet.get(w).y + firstSet.get(y).y);
                                Point midPointDiagonal2 = new Point(-1, firstSet.get(x).x + firstSet.get(z).x, firstSet.get(x).y + firstSet.get(z).y);
                                if (midPointDiagonal1.x == midPointDiagonal2.x && midPointDiagonal1.y == midPointDiagonal2.y) {
                                    if (firstSet.get(w).distance(firstSet.get(y)) == firstSet.get(x).distance(firstSet.get(z)) && firstSet.get(w).distance(firstSet.get(y)) != 0) {
                                        first = 1;
                                        long distance1 = firstSet.get(w).distance(firstSet.get(x));
                                        long distance2 = firstSet.get(x).distance(firstSet.get(y));
                                        long distance3 = firstSet.get(y).distance(firstSet.get(z));
                                        long distance4 = firstSet.get(z).distance(firstSet.get(w));
                                        if (distance1 == distance2 && distance2 == distance3 && distance3 == distance4 && distance4 == distance1 && distance1 != 0) {
                                            first = 2;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                for (int w = 0; w < 4; ++w) {
                    for (int x = 0; x < 4; ++x) {
                        if (x == w) continue;
                        for (int y = 0; y < 4; ++y) {
                            if (y == w || y == x) continue;
                            for (int z = 0; z < 4; ++z) {
                                if (z == w || z == y || z == x) continue;
                                Point midPointDiagonal1 = new Point(-1, secondSet.get(w).x + secondSet.get(y).x, secondSet.get(w).y + secondSet.get(y).y);
                                Point midPointDiagonal2 = new Point(-1, secondSet.get(x).x + secondSet.get(z).x, secondSet.get(x).y + secondSet.get(z).y);
                                if (midPointDiagonal1.x == midPointDiagonal2.x && midPointDiagonal1.y == midPointDiagonal2.y) {
                                    if (secondSet.get(w).distance(secondSet.get(y)) == secondSet.get(x).distance(secondSet.get(z)) && secondSet.get(w).distance(secondSet.get(y)) != 0) {
                                        second = 1;
                                        long distance1 = secondSet.get(w).distance(secondSet.get(x));
                                        long distance2 = secondSet.get(x).distance(secondSet.get(y));
                                        long distance3 = secondSet.get(y).distance(secondSet.get(z));
                                        long distance4 = secondSet.get(z).distance(secondSet.get(w));
                                        if (distance1 == distance2 && distance2 == distance3 && distance3 == distance4 && distance4 == distance1 && distance1 != 0) {
                                            second = 2;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                if ((first == 1 && second == 2) || (first == 2 && second == 1) || (first == 2 && second == 2)) {
                    out.println("YES");
                    int square = (first == 2) ? 1 : 2;
                    int rectangle = (square == 1) ? 2 : 1;
                    if (square == 1) printPointList(firstSet, out);
                    else printPointList(secondSet, out);
                    if (rectangle == 1) printPointList(firstSet, out);
                    else printPointList(secondSet, out);
                    possible = true;
                    break;
                }
            }
        }
        if (!possible)
            out.println("NO");

        in.close();
        out.close();
    }

    public static void printPointList(ArrayList<Point> points, PrintWriter out) {
        for (int i = 0; i < points.size(); ++i) {
            out.print(points.get(i).id);
            if (i != points.size() - 1)
                out.print(" ");
        }
        out.println();
    }

    public static class Point {
        int id, x, y;

        public Point(int id, int x, int y) {
            this.id = id;
            this.x = x;
            this.y = y;
        }

        public long distance(Point another) {
            int dx = this.x - another.x;
            int dy = this.y - another.y;
            return (long) (dx * dx + dy * dy);
        }
    }
}


import java.util.Scanner;

public class D {
    static int[] x,y;
    static int sol;
    static boolean found;
    public static void find(int rem,int mask) {
        if(found) return;
        if(rem==0) {
            long[] sqx=new long[4];
            long[] sqy=new long[4];
            long[] recx=new long[4];
            long[] recy=new long[4];
            int idxsq=0,idxrec=0;
            for(int i=0;i<8;i++) {
                if(((1<<i)|mask)==mask){
                    sqx[idxsq]=x[i];
                    sqy[idxsq++]=y[i];
                }else {
                    recx[idxrec]=x[i];
                    recy[idxrec++]=y[i];
                }
            }
            boolean sq=false,rec=false;
            for(int i=1;i<4;i++) {
                long hyp=(sqx[i]-sqx[0])*(sqx[i]-sqx[0])+(sqy[i]-sqy[0])*(sqy[i]-sqy[0]);
                long len1,len2,len3,len4;
                if(i==1){
                len1=(sqx[2]-sqx[0])*(sqx[2]-sqx[0])+(sqy[2]-sqy[0])*(sqy[2]-sqy[0]);
                len2=(sqx[2]-sqx[1])*(sqx[2]-sqx[1])+(sqy[2]-sqy[1])*(sqy[2]-sqy[1]);
                len3=(sqx[3]-sqx[0])*(sqx[3]-sqx[0])+(sqy[3]-sqy[0])*(sqy[3]-sqy[0]);
                len4=(sqx[3]-sqx[1])*(sqx[3]-sqx[1])+(sqy[3]-sqy[1])*(sqy[3]-sqy[1]);
                if(len1+len2==hyp&&len3+len4==hyp){
                    if(len1==len2&&len2==len3&&len3==len4)
                    sq=true; break;
                }
                }else if(i==2){
                    len1=(sqx[1]-sqx[0])*(sqx[1]-sqx[0])+(sqy[1]-sqy[0])*(sqy[1]-sqy[0]);
                    len2=(sqx[1]-sqx[2])*(sqx[1]-sqx[2])+(sqy[1]-sqy[2])*(sqy[1]-sqy[2]);
                    len3=(sqx[3]-sqx[0])*(sqx[3]-sqx[0])+(sqy[3]-sqy[0])*(sqy[3]-sqy[0]);
                    len4=(sqx[3]-sqx[2])*(sqx[3]-sqx[2])+(sqy[3]-sqy[2])*(sqy[3]-sqy[2]);
                    if(len1+len2==hyp&&len3+len4==hyp){
                        if(len1==len2&&len2==len3&&len3==len4)
                        sq=true; break;
                    }
                }else{
                    len1=(sqx[1]-sqx[0])*(sqx[1]-sqx[0])+(sqy[1]-sqy[0])*(sqy[1]-sqy[0]);
                    len2=(sqx[1]-sqx[3])*(sqx[1]-sqx[3])+(sqy[1]-sqy[3])*(sqy[1]-sqy[3]);
                    len3=(sqx[2]-sqx[0])*(sqx[2]-sqx[0])+(sqy[2]-sqy[0])*(sqy[2]-sqy[0]);
                    len4=(sqx[2]-sqx[3])*(sqx[2]-sqx[3])+(sqy[2]-sqy[3])*(sqy[2]-sqy[3]);
                    if(len1+len2==hyp&&len3+len4==hyp){
                        if(len1==len2&&len2==len3&&len3==len4)
                        sq=true; break;
                    }
                }
            }
            for(int i=1;i<4;i++) {
                long hyp=(x[i]-recx[0])*(recx[i]-recx[0])+(recy[i]-recy[0])*(recy[i]-recy[0]);
                long len1,len2,len3,len4;
                if(i==1){
                len1=(recx[2]-recx[0])*(recx[2]-recx[0])+(recy[2]-recy[0])*(recy[2]-recy[0]);
                len2=(recx[2]-recx[1])*(recx[2]-recx[1])+(recy[2]-recy[1])*(recy[2]-recy[1]);
                len3=(recx[3]-recx[0])*(recx[3]-recx[0])+(recy[3]-recy[0])*(recy[3]-recy[0]);
                len4=(recx[3]-recx[1])*(recx[3]-recx[1])+(recy[3]-recy[1])*(recy[3]-recy[1]);
                if(len1+len2==hyp&&len3+len4==hyp){
                    rec=true; break;
                }
                }else if(i==2){
                    len1=(recx[1]-recx[0])*(recx[1]-recx[0])+(recy[1]-recy[0])*(recy[1]-recy[0]);
                    len2=(recx[1]-recx[2])*(recx[1]-recx[2])+(recy[1]-recy[2])*(recy[1]-recy[2]);
                    len3=(recx[3]-recx[0])*(recx[3]-recx[0])+(recy[3]-recy[0])*(recy[3]-recy[0]);
                    len4=(recx[3]-recx[2])*(recx[3]-recx[2])+(recy[3]-recy[2])*(recy[3]-recy[2]);
                    if(len1+len2==hyp&&len3+len4==hyp){
                        rec=true; break;
                    }
                }else{
                    len1=(recx[1]-recx[0])*(recx[1]-recx[0])+(recy[1]-recy[0])*(recy[1]-recy[0]);
                    len2=(recx[1]-recx[3])*(recx[1]-recx[3])+(recy[1]-recy[3])*(recy[1]-recy[3]);
                    len3=(recx[2]-recx[0])*(recx[2]-recx[0])+(recy[2]-recy[0])*(recy[2]-recy[0]);
                    len4=(recx[2]-recx[3])*(recx[2]-recx[3])+(recy[2]-recy[3])*(recy[2]-recy[3]);
                    if(len1+len2==hyp&&len3+len4==hyp){
                        rec=true; break;
                    }
                }
            }
            if(sq&&rec) {
                found=true;
                sol=mask;
            }
        }
        else {
            for(int i=0;i<8;i++) {
                if(((1<<i)|mask)!=mask){
                    find(rem-1,mask|(1<<i));
                }
            }
        }
    }
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        x=new int[8];
        y=new int[8];
        for(int i=0;i<8;i++){
            x[i]=sc.nextInt();
            y[i]=sc.nextInt();
        }
        sol=0;
        found=false;
        find(4,0);
        if(found){
            System.out.println("YES");
            for(int i=0;i<8;i++) {
                if(((1<<i)|sol)==sol){
                    System.out.print((i+1)+" ");
                }

            }
            System.out.println();
            for(int i=0;i<8;i++) {
                if(((1<<i)|sol)!=sol){
                    System.out.print((i+1)+" ");
                }

            }
            System.out.println();
        }else {
            System.out.println("NO");
        }
    }
}


import java.util.Scanner;

public class D {
    static int[] x,y;
    static int sol;
    static boolean found;
    public static void find(int rem,int mask) {
        if(found) return;
        if(rem==0) {
            long[] sqx=new long[4];
            long[] sqy=new long[4];
            long[] recx=new long[4];
            long[] recy=new long[4];
            int idxsq=0,idxrec=0;
            for(int i=0;i<8;i++) {
                if(((1<<i)|mask)==mask){
                    sqx[idxsq]=x[i];
                    sqy[idxsq++]=y[i];
                }else {
                    recx[idxrec]=x[i];
                    recy[idxrec++]=y[i];
                }
            }
            boolean sq=false,rec=false;
            for(int i=1;i<4;i++) {
                long hyp=(sqx[i]-sqx[0])*(sqx[i]-sqx[0])+(sqy[i]-sqy[0])*(sqy[i]-sqy[0]);
                long len1,len2,len3,len4;
                if(i==1){
                len1=(sqx[2]-sqx[0])*(sqx[2]-sqx[0])+(sqy[2]-sqy[0])*(sqy[2]-sqy[0]);
                len2=(sqx[2]-sqx[1])*(sqx[2]-sqx[1])+(sqy[2]-sqy[1])*(sqy[2]-sqy[1]);
                len3=(sqx[3]-sqx[0])*(sqx[3]-sqx[0])+(sqy[3]-sqy[0])*(sqy[3]-sqy[0]);
                len4=(sqx[3]-sqx[1])*(sqx[3]-sqx[1])+(sqy[3]-sqy[1])*(sqy[3]-sqy[1]);
                if(len1+len2==hyp&&len3+len4==hyp){
                    if(len1==len2&&len2==len3&&len3==len4)
                    sq=true; break;
                }
                }else if(i==2){
                    len1=(sqx[1]-sqx[0])*(sqx[1]-sqx[0])+(sqy[1]-sqy[0])*(sqy[1]-sqy[0]);
                    len2=(sqx[1]-sqx[2])*(sqx[1]-sqx[2])+(sqy[1]-sqy[2])*(sqy[1]-sqy[2]);
                    len3=(sqx[3]-sqx[0])*(sqx[3]-sqx[0])+(sqy[3]-sqy[0])*(sqy[3]-sqy[0]);
                    len4=(sqx[3]-sqx[2])*(sqx[3]-sqx[2])+(sqy[3]-sqy[2])*(sqy[3]-sqy[2]);
                    if(len1+len2==hyp&&len3+len4==hyp){
                        if(len1==len2&&len2==len3&&len3==len4)
                        sq=true; break;
                    }
                }else{
                    len1=(sqx[1]-sqx[0])*(sqx[1]-sqx[0])+(sqy[1]-sqy[0])*(sqy[1]-sqy[0]);
                    len2=(sqx[1]-sqx[3])*(sqx[1]-sqx[3])+(sqy[1]-sqy[3])*(sqy[1]-sqy[3]);
                    len3=(sqx[2]-sqx[0])*(sqx[2]-sqx[0])+(sqy[2]-sqy[0])*(sqy[2]-sqy[0]);
                    len4=(sqx[2]-sqx[3])*(sqx[2]-sqx[3])+(sqy[2]-sqy[3])*(sqy[2]-sqy[3]);
                    if(len1+len2==hyp&&len3+len4==hyp){
                        if(len1==len2&&len2==len3&&len3==len4)
                        sq=true; break;
                    }
                }
            }
            for(int i=1;i<4;i++) {
                long hyp=(recx[i]-recx[0])*(recx[i]-recx[0])+(recy[i]-recy[0])*(recy[i]-recy[0]);
                long len1,len2,len3,len4;
                if(i==1){
                len1=(recx[2]-recx[0])*(recx[2]-recx[0])+(recy[2]-recy[0])*(recy[2]-recy[0]);
                len2=(recx[2]-recx[1])*(recx[2]-recx[1])+(recy[2]-recy[1])*(recy[2]-recy[1]);
                len3=(recx[3]-recx[0])*(recx[3]-recx[0])+(recy[3]-recy[0])*(recy[3]-recy[0]);
                len4=(recx[3]-recx[1])*(recx[3]-recx[1])+(recy[3]-recy[1])*(recy[3]-recy[1]);
                if(len1+len2==hyp&&len3+len4==hyp){
                    rec=true; break;
                }
                }else if(i==2){
                    len1=(recx[1]-recx[0])*(recx[1]-recx[0])+(recy[1]-recy[0])*(recy[1]-recy[0]);
                    len2=(recx[1]-recx[2])*(recx[1]-recx[2])+(recy[1]-recy[2])*(recy[1]-recy[2]);
                    len3=(recx[3]-recx[0])*(recx[3]-recx[0])+(recy[3]-recy[0])*(recy[3]-recy[0]);
                    len4=(recx[3]-recx[2])*(recx[3]-recx[2])+(recy[3]-recy[2])*(recy[3]-recy[2]);
                    if(len1+len2==hyp&&len3+len4==hyp){
                        rec=true; break;
                    }
                }else{
                    len1=(recx[1]-recx[0])*(recx[1]-recx[0])+(recy[1]-recy[0])*(recy[1]-recy[0]);
                    len2=(recx[1]-recx[3])*(recx[1]-recx[3])+(recy[1]-recy[3])*(recy[1]-recy[3]);
                    len3=(recx[2]-recx[0])*(recx[2]-recx[0])+(recy[2]-recy[0])*(recy[2]-recy[0]);
                    len4=(recx[2]-recx[3])*(recx[2]-recx[3])+(recy[2]-recy[3])*(recy[2]-recy[3]);
                    if(len1+len2==hyp&&len3+len4==hyp){
                        rec=true; break;
                    }
                }
            }
            if(sq&&rec) {
                found=true;
                sol=mask;
            }
        }
        else {
            for(int i=0;i<8;i++) {
                if(((1<<i)|mask)!=mask){
                    find(rem-1,mask|(1<<i));
                }
            }
        }
    }
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        x=new int[8];
        y=new int[8];
        for(int i=0;i<8;i++){
            x[i]=sc.nextInt();
            y[i]=sc.nextInt();
        }
        sol=0;
        found=false;
        find(4,0);
        if(found){
            System.out.println("YES");
            for(int i=0;i<8;i++) {
                if(((1<<i)|sol)==sol){
                    System.out.print((i+1)+" ");
                }

            }
            System.out.println();
            for(int i=0;i<8;i++) {
                if(((1<<i)|sol)!=sol){
                    System.out.print((i+1)+" ");
                }

            }
            System.out.println();
        }else {
            System.out.println("NO");
        }
    }
}