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

public class Main {

    public final FastScanner in;
    public final PrintWriter out;

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

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

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

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

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

            return null;
        }

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

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

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

            return false;

        }

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

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

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

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

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

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

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

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

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

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

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

        System.out.println("NO");

    }
}

class Vector {

    int index;
    double x, y;

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

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

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

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

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

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

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

        if (res == 0)
            return true;

        return false;
    }

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

}

class FastScanner {
    BufferedReader br;
    StringTokenizer st;

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

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

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

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

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

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

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

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

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

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


import java.awt.Point;
import java.io.*;
import java.util.*;

public class D {
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader r=new BufferedReader(new InputStreamReader(System.in));
		Point[] points=new Point[8];
		for (int i = 0; i < points.length; i++) {
			String[] sp=r.readLine().split("[ ]+");
			points[i]=new Point(new Integer(sp[0]),new Integer(sp[1]));
		}
		for(int i=0;i<(1<<8);i++){
			if(Integer.bitCount(i)==4){
				Point[] set1=new Point[4];
				Point[] set2=new Point[4];
				Vector<Integer> a=new Vector<Integer>();
				Vector<Integer> b=new Vector<Integer>();
				int x=0,y=0;
				for(int j=0;j<8;j++){
					if(((1<<j)&i)==(1<<j)){
						set1[x++]=new Point(points[j].x,points[j].y);
						a.add(j+1);
					}
					else{
						set2[y++]=new Point(points[j].x,points[j].y);
						b.add(j+1);
					}
				}
				if(isSquare(set1)&&isRectangle(set2)){
					System.out.println("YES");
					print(a);
					print(b);
					System.exit(0);
				}
				else if(isSquare(set2)&&isRectangle(set1)){
					System.out.println("YES");
					print(b);
					print(a);
					System.exit(0);
				}
			}
		}
		System.out.println("NO");
	}

	private static void print(Vector<Integer> a) {
		System.out.println(a.get(0)+" "+a.get(1)+" "+a.get(2)+" "+a.get(3));
	}

	private static boolean isRectangle(Point[] set2) {
		isRect=false;
		s2=set2;
		dfsR(0,new int[]{0,1,2,3},new int[4],new boolean[4]);
		return isRect;
	}
static boolean isSquare;
static Point[] s1;
static boolean isRect;
static Point[] s2;
	private static boolean isSquare(Point[] set1) {
		isSquare=false;
		s1=set1;
		dfsS(0,new int[]{0,1,2,3},new int[4],new boolean[4]);
		return isSquare;
	}
	public static double len(Point a,Point b){
		double dx=a.x-b.x;
		double dy=a.y-b.y;
		double side=dx*dx+dy*dy; // Sqrt side !
		return side;
	}
	public static void dfsS(int i,int[] a,int[]order,boolean[] v){
		if(order.length==i){
			double dx=s1[order[0]].x-s1[order[1]].x;
			double dy=s1[order[0]].y-s1[order[1]].y;
			double side=dx*dx+dy*dy; // Sqrt side !
			boolean can=true;
			for(int j=0;j<4;j++){
				Point x=s1[order[j]];
				Point y=s1[order[(j+1)%4]];
				Point z=s1[order[(j+2)%4]];
				double hypt=len(x,z);
				double first=len(x,y);
				double sec=len(y,z);
				if(first+sec!=hypt){
					can=false;
					break;
				}
			}
			for(int j=0;j<4;j++){
				double s=len(s1[order[j]],s1[order[(j+1)%4]]);
				if(s!=side){
					can=false;
					break;
				}
			}
			if(can){
				isSquare=true;
			}
		}
		else{
		for(int j=0;j<a.length;j++){
			if(v[j]) continue;
			order[i]=a[j];
			v[j]=true;
			dfsS(i+1,a,order,v);
			v[j]=false;
		}
		}
	}

	public static void dfsR(int i,int[] a,int[]order,boolean[] v){
		if(order.length==i){
			double dx=s2[order[0]].x-s2[order[1]].x;
			double dy=s2[order[0]].y-s2[order[1]].y;
			double side=dx*dx+dy*dy; // Sqrt side !
			boolean can=true;
			for(int j=0;j<4;j++){
				Point x=s2[order[j]];
				Point y=s2[order[(j+1)%4]];
				Point z=s2[order[(j+2)%4]];
				double hypt=len(x,z);
				double first=len(x,y);
				double sec=len(y,z);
				if(first+sec!=hypt){
					can=false;
					break;
				}
			}
			double second=len(s2[order[1]],s2[order[2]]);
			double third=len(s2[order[2]],s2[order[3]]);
			double fourth=len(s2[order[3]],s2[order[0]]);
			if(side==third&&second==fourth){

			}
			else{
				can=false;
			}
			if(can){
				isRect=true;
			}
		}
		else{
		for(int j=0;j<a.length;j++){
			if(v[j]) continue;
			order[i]=a[j];
			v[j]=true;
			dfsR(i+1,a,order,v);
			v[j]=false;
		}
		}
	}

}


//package d;
import java.util.*;
import java.io.*;

public class Main {

	public void run() throws Exception {
		Scanner in = new Scanner(new File("input.txt"));
		int []x = new int[8];
		int []y = new int[8];
		for (int i = 0; i < 8; i++) {
			x[i] = in.nextInt();
			y[i] = in.nextInt();
		}
		int a[] = new int[8];
		point p[] = new point[8];
		for(int i=1;i<8;i++) a[i] = i;
		while(a.length != 0){
			for(int i=0;i<8;i++)
				p[i] = new point(x[a[i]], y[a[i]]);
			if (isSquare(p[0], p[1], p[2], p[3]) && isRect(p[4], p[5], p[6], p[7])){
				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) + " ");
				}
				return;
			}
			a = nextPermutation(a);
		}
		System.out.println("NO");
	}

	private boolean isSquare(point a, point b, point c, point d){
		int dis = a.len(b);
		if (dis != b.len(c)) return false;
		if (dis != c.len(d)) return false;
		if (dis != d.len(a)) return false;

		if (!b.is90(a, c)) return false;
		if (!c.is90(b, d)) return false;
		if (!d.is90(c, a)) return false;
		if (!a.is90(b, d)) return false;

		return true;
	}

	private boolean isRect(point a, point b, point c, point d){

		if (!b.is90(a, c)) return false;
		if (!c.is90(b, d)) return false;
		if (!d.is90(c, a)) return false;
		if (!a.is90(b, d)) return false;

		int dis = a.len(b);
		if (dis != c.len(d)) return false;
		dis = b.len(c);
		if (dis != d.len(a)) return false;

		return true;
	}

	int yk = 0;
	boolean used[];

		private int[] nextPermutation(int a[]) {
		int k = a.length - 2;
		int min = Integer.MAX_VALUE;
		int t = 0;
		while (a[k] > a[k + 1]) {
			k--;
			if (k < 0)
				return new int[0];
		}
		for (int i = k + 1; i < a.length; i++)
			if (a[k] < a[i] && min > a[i]) {
				min = a[i];
				t = i;
			}
		a[t] = a[k];
		a[k] = min;
		for (int i = k + 1, j = a.length - 1; i < j; i++, j--) {
			t = a[i];
			a[i] = a[j];
			a[j] = t;
		}
		return a;
	}

	public static void main(String[] args) throws Exception {
		new Main().run();
	}
}
class point{
	int x, y;
	public point(int x, int y){
		this.x = x;
		this.y = y;
	}

	public int len(point p){
		return (p.x - this.x)*(p.x - this.x) + (p.y - this.y)*(p.y - this.y);
	}

	public boolean is90(point p1, point p2){
		int a1 = this.x - p1.x;
		int b1 = this.y - p1.y;
		int a2 = this.x - p2.x;
		int b2 = this.y - p2.y;

		return a1*a2 + b1*b2 == 0;
	}
}


//package d;
import java.util.*;
import java.io.*;

public class Main {

	public void run() throws Exception {
		Scanner in = new Scanner(System.in);
		int []x = new int[8];
		int []y = new int[8];
		for (int i = 0; i < 8; i++) {
			x[i] = in.nextInt();
			y[i] = in.nextInt();
		}
		int a[] = new int[8];
		point p[] = new point[8];
		for(int i=1;i<8;i++) a[i] = i;
		while(a.length != 0){
			for(int i=0;i<8;i++)
				p[i] = new point(x[a[i]], y[a[i]]);
			if (isSquare(p[0], p[1], p[2], p[3]) && isRect(p[4], p[5], p[6], p[7])){
				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) + " ");
				}
				return;
			}
			a = nextPermutation(a);
		}
		System.out.println("NO");
	}

	private boolean isSquare(point a, point b, point c, point d){
		int dis = a.len(b);
		if (dis != b.len(c)) return false;
		if (dis != c.len(d)) return false;
		if (dis != d.len(a)) return false;

		if (!b.is90(a, c)) return false;
		if (!c.is90(b, d)) return false;
		if (!d.is90(c, a)) return false;
		if (!a.is90(b, d)) return false;

		return true;
	}

	private boolean isRect(point a, point b, point c, point d){

		if (!b.is90(a, c)) return false;
		if (!c.is90(b, d)) return false;
		if (!d.is90(c, a)) return false;
		if (!a.is90(b, d)) return false;

		int dis = a.len(b);
		if (dis != c.len(d)) return false;
		dis = b.len(c);
		if (dis != d.len(a)) return false;

		return true;
	}

	int yk = 0;
	boolean used[];

		private int[] nextPermutation(int a[]) {
		int k = a.length - 2;
		int min = Integer.MAX_VALUE;
		int t = 0;
		while (a[k] > a[k + 1]) {
			k--;
			if (k < 0)
				return new int[0];
		}
		for (int i = k + 1; i < a.length; i++)
			if (a[k] < a[i] && min > a[i]) {
				min = a[i];
				t = i;
			}
		a[t] = a[k];
		a[k] = min;
		for (int i = k + 1, j = a.length - 1; i < j; i++, j--) {
			t = a[i];
			a[i] = a[j];
			a[j] = t;
		}
		return a;
	}

	public static void main(String[] args) throws Exception {
		new Main().run();
	}
}
class point{
	int x, y;
	public point(int x, int y){
		this.x = x;
		this.y = y;
	}

	public int len(point p){
		return (p.x - this.x)*(p.x - this.x) + (p.y - this.y)*(p.y - this.y);
	}

	public boolean is90(point p1, point p2){
		int a1 = this.x - p1.x;
		int b1 = this.y - p1.y;
		int a2 = this.x - p2.x;
		int b2 = this.y - p2.y;

		return a1*a2 + b1*b2 == 0;
	}
}


//package d;

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

public class Main {

	int[] x1, y1;

	public void run() throws Exception {
		Scanner in = new Scanner(new File("input.txt"));
		x1 = new int[8];
		y1 = new int[8];
		for (int i = 0; i < 8; i++) {
			x1[i] = in.nextInt();
			y1[i] = in.nextInt();
		}
		used = new boolean[8];
		C(0);
		System.out.println("NO");
	}

	int yk = 0;
	boolean used[];

	private void C(int x) {
		if (yk == 4) {

			if (checkSquare() && checkRectangle()) {
				System.out.println("YES");
				for (int i = 0; i < 8; i++)
					if (used[i])
						System.out.print((i + 1) + " ");
				System.out.println();
				for (int i = 0; i < 8; i++)
					if (!used[i])
						System.out.print((i + 1) + " ");

				System.out.println();
				System.exit(0);
			}
		} else {
			for (int i = x; i < 8; i++) {
				if (!used[i]) {
					used[i] = true;
					yk++;
					C(i);
					yk--;
					used[i] = false;
				}
			}
		}
	}

	private boolean checkRectangle() {

		int x2[] = new int[4];
		int y2[] = new int[4];
		int c = 0;
		for (int i = 0; i < 8; i++) {
			if (used[i]) {
				x2[c] = x1[i];
				y2[c++] = y1[i];
			}
		}

		int a[] = new int[4];
		for (int i = 1; i < 4; i++)
			a[i] = i;
		int x[] = new int[4];
		int y[] = new int[4];

		while (a.length != 0) {

			for(int i=0;i<4;i++){
				x[i] = x2[a[i]];
				y[i] = y2[a[i]];
			}

			boolean ok = true;
			int dis1 = -1;
			int dis2 = -1;
			for (int i = 0; i < 4; i++) {
				int next = (i + 1) % 4;
				int d = (int) Math.pow(x[i] - x[next], 2)
						+ (int) Math.pow(y[i] - y[next], 2);
				if (dis1 == -1) {
					dis1 = d;
				} else if (dis1 != d) {
					if (dis2 == -1)
						dis2 = d;
					else if (dis2 != d){
						ok = false;
						break;
					}
				}
			}

			for (int i = 0; i < 4; i++) {
				int next = (i + 1) % 4;
				int nextt = (i + 2) % 4;
				int a1 = x[next] - x[i];
				int b1 = y[next] - y[i];
				int a2 = x[next] - x[nextt];
				int b2 = y[next] - y[nextt];

				if (a1 * a2 + b1 * b2 != 0){
					ok = false;
					break;
				}
			}
			if (ok) return true;
			a = nextPermutation(a);
		}
		return false;
	}

	private boolean checkSquare() {
		int x2[] = new int[4];
		int y2[] = new int[4];
		int c = 0;
		for (int i = 0; i < 8; i++) {
			if (used[i]) {
				x2[c] = x1[i];
				y2[c++] = y1[i];
			}
		}

		int a[] = new int[4];
		for (int i = 1; i < 4; i++)
			a[i] = i;
		int x[] = new int[4];
		int y[] = new int[4];
		while (a.length != 0) {
			for (int i = 0; i < 4; i++) {
				x[i] = x2[a[i]];
				y[i] = y2[a[i]];
			}

			int dis = -1;
			boolean ok = true;
			for (int i = 0; i < 4; i++) {
				int next = (i + 1) % 4;
				int d = (int) Math.pow(x[i] - x[next], 2)
						+ (int) Math.pow(y[i] - y[next], 2);
				if (dis == -1) {
					dis = d;
				} else if (dis != d) {
					ok = false;
					break;
				}
			}

			for (int i = 0; i < 4; i++) {
				int next = (i + 1) % 4;
				int nextt = (i + 2) % 4;
				int a1 = x[next] - x[i];
				int b1 = y[next] - y[i];
				int a2 = x[next] - x[nextt];
				int b2 = y[next] - y[nextt];

				if (a1 * a2 + b1 * b2 != 0) {
					ok = false;
					break;
				}
			}
			if (ok)
				return true;
			a = nextPermutation(a);
		}
		return false;
	}

	private int[] nextPermutation(int a[]) {
		int k = a.length - 2;
		int min = Integer.MAX_VALUE;
		int t = 0;
		while (a[k] > a[k + 1]) {
			k--;
			if (k < 0)
				return new int[0];
		}
		for (int i = k + 1; i < a.length; i++)
			if (a[k] < a[i] && min > a[i]) {
				min = a[i];
				t = i;
			}
		a[t] = a[k];
		a[k] = min;
		for (int i = k + 1, j = a.length - 1; i < j; i++, j--) {
			t = a[i];
			a[i] = a[j];
			a[j] = t;
		}
		return a;
	}

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


//package d;

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

public class Main {

	int[] x1, y1;

	public void run() throws Exception {
		Scanner in = new Scanner(System.in);
		x1 = new int[8];
		y1 = new int[8];
		for (int i = 0; i < 8; i++) {
			x1[i] = in.nextInt();
			y1[i] = in.nextInt();
		}
		used = new boolean[8];
		C(0);
		System.out.println("NO");
	}

	int yk = 0;
	boolean used[];

	private void C(int x) {
		if (yk == 4) {

			if (checkSquare() && checkRectangle()) {
				System.out.println("YES");
				for (int i = 0; i < 8; i++)
					if (used[i])
						System.out.print((i + 1) + " ");
				System.out.println();
				for (int i = 0; i < 8; i++)
					if (!used[i])
						System.out.print((i + 1) + " ");

				System.out.println();
				System.exit(0);
			}
		} else {
			for (int i = x; i < 8; i++) {
				if (!used[i]) {
					used[i] = true;
					yk++;
					C(i);
					yk--;
					used[i] = false;
				}
			}
		}
	}

	private boolean checkRectangle() {

		int x2[] = new int[4];
		int y2[] = new int[4];
		int c = 0;
		for (int i = 0; i < 8; i++) {
			if (used[i]) {
				x2[c] = x1[i];
				y2[c++] = y1[i];
			}
		}

		int a[] = new int[4];
		for (int i = 1; i < 4; i++)
			a[i] = i;
		int x[] = new int[4];
		int y[] = new int[4];

		while (a.length != 0) {

			for(int i=0;i<4;i++){
				x[i] = x2[a[i]];
				y[i] = y2[a[i]];
			}

			boolean ok = true;
			int dis1 = -1;
			int dis2 = -1;
			for (int i = 0; i < 4; i++) {
				int next = (i + 1) % 4;
				int d = (int) Math.pow(x[i] - x[next], 2)
						+ (int) Math.pow(y[i] - y[next], 2);
				if (dis1 == -1) {
					dis1 = d;
				} else if (dis1 != d) {
					if (dis2 == -1)
						dis2 = d;
					else if (dis2 != d){
						ok = false;
						break;
					}
				}
			}

			for (int i = 0; i < 4; i++) {
				int next = (i + 1) % 4;
				int nextt = (i + 2) % 4;
				int a1 = x[next] - x[i];
				int b1 = y[next] - y[i];
				int a2 = x[next] - x[nextt];
				int b2 = y[next] - y[nextt];

				if (a1 * a2 + b1 * b2 != 0){
					ok = false;
					break;
				}
			}
			if (ok) return true;
			a = nextPermutation(a);
		}
		return false;
	}

	private boolean checkSquare() {
		int x2[] = new int[4];
		int y2[] = new int[4];
		int c = 0;
		for (int i = 0; i < 8; i++) {
			if (used[i]) {
				x2[c] = x1[i];
				y2[c++] = y1[i];
			}
		}

		int a[] = new int[4];
		for (int i = 1; i < 4; i++)
			a[i] = i;
		int x[] = new int[4];
		int y[] = new int[4];
		while (a.length != 0) {
			for (int i = 0; i < 4; i++) {
				x[i] = x2[a[i]];
				y[i] = y2[a[i]];
			}

			int dis = -1;
			boolean ok = true;
			for (int i = 0; i < 4; i++) {
				int next = (i + 1) % 4;
				int d = (int) Math.pow(x[i] - x[next], 2)
						+ (int) Math.pow(y[i] - y[next], 2);
				if (dis == -1) {
					dis = d;
				} else if (dis != d) {
					ok = false;
					break;
				}
			}

			for (int i = 0; i < 4; i++) {
				int next = (i + 1) % 4;
				int nextt = (i + 2) % 4;
				int a1 = x[next] - x[i];
				int b1 = y[next] - y[i];
				int a2 = x[next] - x[nextt];
				int b2 = y[next] - y[nextt];

				if (a1 * a2 + b1 * b2 != 0) {
					ok = false;
					break;
				}
			}
			if (ok)
				return true;
			a = nextPermutation(a);
		}
		return false;
	}

	private int[] nextPermutation(int a[]) {
		int k = a.length - 2;
		int min = Integer.MAX_VALUE;
		int t = 0;
		while (a[k] > a[k + 1]) {
			k--;
			if (k < 0)
				return new int[0];
		}
		for (int i = k + 1; i < a.length; i++)
			if (a[k] < a[i] && min > a[i]) {
				min = a[i];
				t = i;
			}
		a[t] = a[k];
		a[k] = min;
		for (int i = k + 1, j = a.length - 1; i < j; i++, j--) {
			t = a[i];
			a[i] = a[j];
			a[j] = t;
		}
		return a;
	}

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


import java.lang.*;
import java.util.*;

public class Main {
    public static int[] x = new int[8], y = new int[8];
    public static int isRec(int[] p) {
        int i, j, k, l;
        for (i = 0; i < 4; i++) {
            for (j = 0; j < 4; j++) {
                for (k = 0; k < 4; k++) {
                     for (l = 0; l < 4; l++) {
                         if (i == j || i == k || i == k || i == l || j == k || j == l || k == l) continue;
                         if ((x[p[k]] - x[p[i]]) * (x[p[j]] - x[p[i]]) + (y[p[k]] - y[p[i]]) * (y[p[j]] - y[p[i]]) == 0) {
                             if (x[p[j]]- x[p[i]] == x[p[l]] - x[p[k]] && y[p[j]]- y[p[i]] == y[p[l]] - y[p[k]]) {
                                 if ((x[p[k]] - x[p[i]]) * (x[p[k]] - x[p[i]]) + (y[p[k]] - y[p[i]]) * (y[p[k]] - y[p[i]]) ==
                                     (x[p[j]] - x[p[i]]) * (x[p[j]] - x[p[i]]) + (y[p[j]] - y[p[i]]) * (y[p[j]] - y[p[i]])) return 2;
                                 return 1;
                             }
                         }
                    }
                }
            }
        }
        return 0;
    }
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int i, j;
        for (i = 0; i < 8; i++) {
            x[i] = input.nextInt();
            y[i] = input.nextInt();
        }
        int[] p1 = new int[4], p2 = new int[4];
        int s1, s2;
        String output = "NO";
        for (i = 0; i < (1 << 8); i++) {
            if (Integer.bitCount(i) == 4) {
                s1 = s2 = 0;
                for (j = 0; j < 8; j++) {
                    if (((i >> j) & 1) == 1) p1[s1++] = j;
                    else p2[s2++] = j;
                }
                int ret1 = isRec(p1);
                int ret2 = isRec(p2);
                if (ret1 == 2 && ret2 > 0) {
                    output = "YES";
                    break;
                }
            }
        }
        System.out.println(output);
        if (output.equals("YES")) {
            for (i = 0; i < 4; i++) System.out.print((p1[i] + 1) + " ");
            System.out.println();
            for (i = 0; i < 4; i++) System.out.print((p2[i] + 1) + " ");
            System.out.println();
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;

public class ProblemD implements Runnable{

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

    public void solve() throws IOException{
        for(int i=0;i<8;i++){
            int[] inp=intArr();
            x[i]=(long)inp[0];
            y[i]=(long)inp[1];
        }

        int[] ind=new int[4];
        int[] ind2=new int[4];

        for(ind[0]=0;ind[0]<8;ind[0]++){
            for(ind[1]=ind[0]+1;ind[1]<8;ind[1]++){
                for(ind[2]=ind[1]+1;ind[2]<8;ind[2]++){
                    for(ind[3]=ind[2]+1;ind[3]<8;ind[3]++){
                        int ii=0;
                        for(int i=0;i<8;i++){
                            boolean found=true;
                            for(int j=0;j<4;j++){
                                if(ind[j]==i){
                                    found=false;
                                    break;
                                }
                            }
                            if(found){
                                ind2[ii]=i;
                                ii++;
                            }
                        }

                        int k1=kindOfFigure(ind);
                        int k2=kindOfFigure(ind2);

                        if(k1==2 && k2>0){
                            out.println("YES");
                            for(int i=0;i<4;i++){
                                if(i>0){
                                    out.print(" ");
                                }
                                out.print(ind[i]+1);
                            }
                            out.println();
                            for(int i=0;i<4;i++){
                                if(i>0){
                                    out.print(" ");
                                }
                                out.print(ind2[i]+1);
                            }
                            out.println();
                            return;
                        }
                    }
                }
            }
        }

        out.println("NO");
    }

    private int kindOfFigure(int[] ind){
        int[] ii=new int[4];
        boolean[] used=new boolean[4];

        ii[0]=0; used[0]=true;

        long[] l2=new long[4];
        for(int i=1;i<4;i++){
            l2[i]=dist2(ind[0],ind[i]);
        }
        ii[1]=indMin(l2, used);
        used[ii[1]]=true;
        ii[3]=indMin(l2, used);
        used[ii[3]]=true;
        ii[2]=indMin(l2, used);
        used[ii[2]]=true;

        long a1=dist2(ind[ii[0]], ind[ii[1]]);
        long a2=dist2(ind[ii[2]], ind[ii[3]]);

        long b1=dist2(ind[ii[0]], ind[ii[3]]);
        long b2=dist2(ind[ii[1]], ind[ii[2]]);

        long c1=dist2(ind[ii[0]], ind[ii[2]]);
        long c2=dist2(ind[ii[1]], ind[ii[3]]);

        int kind=0;
        if(a1==a2 && b1==b2 && c1==c2){
            kind=1;
        }
        if(kind==1 && a1==b1){
            kind=2;
        }
        return kind;
    }

    private long dist2(int ind1, int ind2){
        long dx=x[ind1]-x[ind2];
        long dy=y[ind1]-y[ind2];
        return dx*dx+dy*dy;
    }

    private int indMin(long[] val, boolean[] used){
        long min=Long.MAX_VALUE;
        int ind=-1;
        for(int i=0;i<val.length;i++){
            if(val[i]<min && !used[i]){
                min=val[i];
                ind=i;
            }
        }
        return ind;
    }

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

    @Override
    public void run(){
//      System.out.println("trying to solve");
        try{
            in=new BufferedReader(new InputStreamReader(stdin));
            out=new PrintWriter(stdout);
            solve();
            in.close();
            out.close();
        } catch (Exception ex){
            ex.printStackTrace();
            System.exit(1);
        }
    }

    BufferedReader in;
    PrintWriter out;

    int[] intArr() throws IOException {
        String[] arr=nextLine().split("\\s");
        int[] res=new int[arr.length];
        for(int i=0;i<arr.length;i++) res[i]=Integer.parseInt(arr[i]);
        return res;
    }

    long[] longArr() throws IOException {
        String[] arr=nextLine().split("\\s");
        long[] res=new long[arr.length];
        for(int i=0;i<arr.length;i++) res[i]=Long.parseLong(arr[i]);
        return res;
    }

    double[] doubleArr() throws IOException {
        String[] arr=nextLine().split("\\s");
        double[] res=new double[arr.length];
        for(int i=0;i<arr.length;i++) res[i]=Double.parseDouble(arr[i]);
        return res;
    }

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

    InputStream stdin;
    OutputStream stdout;
    public ProblemD(){
        stdin=System.in;
        stdout=System.out;
    }

    public ProblemD(InputStream stdin, OutputStream stdout){
        this.stdin=stdin;
        this.stdout=stdout;
    }
}


import java.util.ArrayList;
import java.util.Scanner;

public class D {
    static int[]x,y;
    static int[][] comb = {{0, 1, 2, 3}, {0, 2, 1, 3}, {0, 3, 1, 2}};

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        x = new int[9];
        y = new int[9];
        for (int i = 1; i <= 8; i++) {
            x[i] = sc.nextInt();
            y[i] = sc.nextInt();
        }
        for (int i = 0; i < (1 << 8); i++) {
            String ss = Integer.toBinaryString(i);
            while (ss.length() != 8) {
                ss = "0"+ss;
            }
            int cnt = 0;
            for (int j = 0; j < 8; j++) {
                if (ss.charAt(j)=='1') {
                    cnt++;
                }
            }
            if (cnt != 4) {
                continue;
            }
            ArrayList<Integer> squ = new ArrayList<Integer>();
            ArrayList<Integer> rec = new ArrayList<Integer>();
            for (int j = 0; j < 8; j++) {
                if (ss.charAt(j)=='1') {
                    squ.add(j+1);
                }
                else {
                    rec.add(j+1);
                }
            }
            if (squ(squ) && rec(rec)) {
                System.out.println("YES");
                for (int t : squ) {
                    System.out.print(t+" ");
                }
                System.out.println();
                for (int t : rec) {
                    System.out.print(t+" ");
                }
                return;
            }
        }
        System.out.println("NO");
    }

    private static boolean rec(ArrayList<Integer> rec) {
        for (int i = 0; i < 3; i++) {
            int zero = rec.get(comb[i][0]);
            int one = rec.get(comb[i][1]);
            int two = rec.get(comb[i][2]);
            int tree = rec.get(comb[i][3]);
            int a = dis(zero, two);
            int b = dis(zero, tree);
            if (dis(zero, one)==dis(two, tree) && dis(one, two)==b && dis(one, tree)==a) {
                if ((x[tree]-x[zero])*(x[two]-x[zero])+(y[tree]-y[zero])*(y[two]-y[zero])==0) {
                    return true;
                }
            }
        }
        return false;
    }

    private static int dis(int k1, int k2) {
        return (x[k1]-x[k2])*(x[k1]-x[k2])+(y[k1]-y[k2])*(y[k1]-y[k2]);
    }

    private static boolean squ(ArrayList<Integer> squ) {
        for (int i = 0; i < 3; i++) {
            int zero = squ.get(comb[i][0]);
            int one = squ.get(comb[i][1]);
            int two = squ.get(comb[i][2]);
            int tree = squ.get(comb[i][3]);
            int a = dis(zero, two);
            if (dis(zero, one)==dis(two, tree) && dis(zero, tree)==a && dis(one, two)==a && dis(one, tree)==a) {
                if ((x[tree]-x[zero])*(x[two]-x[zero])+(y[tree]-y[zero])*(y[two]-y[zero])==0) {
                    return true;
                }
            }
        }
        return false;
    }
}


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

public class D implements Runnable {

	class Point {
		int x, y;

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

	final int n = 8;
	boolean[] used;
	Point[] points;
	int[] p;

	private void Solution() throws IOException {
		points = new Point[n];
		used = new boolean[n];
		p = new int[n];

		for (int i = 0; i < n; i++) {
			int x = nextInt(), y = nextInt();
			points[i] = new Point(x, y);
		}

		rec(0);

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

	void rec(int k) {
		for (int i = 0; i < n; i++) {
			if (!used[i]) {
				p[k] = i;
				used[i] = true;
				rec(k + 1);
				used[i] = false;
			}
		}
		if (k == n) {
			int[] sq = new int[n / 2];
			int[] rect = new int[n / 2];
			Point[] square = new Point[n / 2];
			Point[] rectangle = new Point[n / 2];

			for (int i = 0; i < n / 2; i++)
				sq[i] = p[i];

			for (int i = 0; i < n / 2; i++)
				rect[i] = p[i + 4];

			for (int i = 0; i < n / 2; i++)
				square[i] = points[sq[i]];

			for (int i = 0; i < n / 2; i++)
				rectangle[i] = points[rect[i]];

			if (isRectangle(rectangle) && isSquare(square)) {
				System.out.println("YES");
				printMas(sq);
				printMas(rect);
				System.exit(0);
			}
		}
		return;
	}

	boolean isRectangle(Point... p) {
		int x1 = p[0].x, y1 = p[0].y;
		int x2 = p[1].x, y2 = p[1].y;
		int x3 = p[2].x, y3 = p[2].y;
		int x4 = p[3].x, y4 = p[3].y;
		double a1 = len(x1, y1, x2, y2);
		double a2 = len(x2, y2, x3, y3);
		double a3 = len(x3, y3, x4, y4);
		double a4 = len(x4, y4, x1, y1);
		double c1 = Math.sqrt(a1 * a1 + a2 * a2);
		double c2 = len(x1, y1, x3, y3);
		return compare(a1, a3) && compare(a2, a4) && compare(c1, c2);
	}

	boolean isSquare(Point... p) {
		int x1 = p[0].x, y1 = p[0].y;
		int x2 = p[1].x, y2 = p[1].y;
		int x3 = p[2].x, y3 = p[2].y;
		int x4 = p[3].x, y4 = p[3].y;
		double a1 = len(x1, y1, x2, y2);
		double a2 = len(x2, y2, x3, y3);
		double a3 = len(x3, y3, x4, y4);
		double a4 = len(x4, y4, x1, y1);
		double c1 = Math.sqrt(a1 * a1 + a2 * a2);
		double c2 = len(x1, y1, x3, y3);
		return compare(a1, a2) && compare(a1, a3) && compare(a1, a4) && compare(c1, c2);
	}

	double len(double x1, double y1, double x2, double y2) {
		return Math.sqrt((y1 - y2) * (y1 - y2) + (x1 - x2) * (x1 - x2));
	}

	boolean compare(double a, double b) {
		final double EPS = 1e-7;
		return Math.abs(a - b) < EPS;
	}

	void printMas(int[] mas) {
		for (int i = 0; i < mas.length; i++) {
			System.out.print(mas[i]+1);
			if (i == mas.length - 1)
				System.out.println();
			else
				System.out.print(" ");
		}
	}

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

	BufferedReader in;
	StringTokenizer tokenizer;

	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			tokenizer = null;
			Solution();
			in.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(0);
		}
	}

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

	String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens())
			tokenizer = new StringTokenizer(in.readLine());
		return tokenizer.nextToken();
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class D implements Runnable {

	class Point {
		int x, y, ind;

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

	private void Solution() throws IOException {
		final int n = 8;
		ArrayList<Point> points = new ArrayList<Point>();
		ArrayList<Integer> sq = new ArrayList<Integer>();
		boolean square = true, rectangle = true;

		for (int i = 0; i < n; i++) {
			int x = nextInt(), y = nextInt();
			points.add(new Point(x, y, i + 1));
		}

		first:
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				for (int k = 0; k < n; k++) {
					for (int l = 0; l < n; l++) {
						if (i == j || i == k || i == l || j == k || j == l || k == l)
							continue;
						int x1 = points.get(i).x, y1 = points.get(i).y;
						int x2 = points.get(j).x, y2 = points.get(j).y;
						int x3 = points.get(k).x, y3 = points.get(k).y;
						int x4 = points.get(l).x, y4 = points.get(l).y;
						double a1 = len(x1, y1, x2, y2);
						double a2 = len(x2, y2, x3, y3);
						double a3 = len(x3, y3, x4, y4);
						double a4 = len(x4, y4, x1, y1);
						double c1 = Math.sqrt(a1 * a1 + a2 * a2);
						double c2 = Math.sqrt(a3 * a3 + a4 * a4);
						if (compare(a1, a2) && compare(a1, a3) && compare(a1, a4) && compare(c1, c2)) {
							sq.add(points.get(i).ind);
							sq.add(points.get(j).ind);
							sq.add(points.get(k).ind);
							sq.add(points.get(l).ind);
							ArrayList<Point> temp = new ArrayList<Point>();
							for (int g = 0; g < n; g ++) {
								if (g == i || g == j || g == k || g == l)
									continue;
								temp.add(points.get(g));
							}
							points = temp;
							square = false;
							break first;
						}
					}
				}
			}
		}

		if (square) {
			System.out.println("NO");
			return;
		}

		second:
		for (int i = 0; i < n / 2; i++) {
			for (int j = 0; j < n / 2; j++) {
				for (int k = 0; k < n / 2; k++) {
					for (int l = 0; l < n / 2; l++) {
						if (i == j || i == k || i == l || j == k || j == l || k == l)
							continue;
						int x1 = points.get(i).x, y1 = points.get(i).y;
						int x2 = points.get(j).x, y2 = points.get(j).y;
						int x3 = points.get(k).x, y3 = points.get(k).y;
						int x4 = points.get(l).x, y4 = points.get(l).y;
						double a1 = len(x1, y1, x2, y2);
						double a2 = len(x2, y2, x3, y3);
						double a3 = len(x3, y3, x4, y4);
						double a4 = len(x4, y4, x1, y1);
						double c1 = Math.sqrt(a1 * a1 + a2 * a2);
						double c2 = Math.sqrt(a3 * a3 + a4 * a4);
						if (compare(a1, a3) && compare(a2, a4) && compare(c1, c2)) {
							rectangle = false;
							break second;
						}
					}
				}
			}
		}

		if (rectangle) {
			System.out.println("NO");
			return;
		}

		System.out.println("YES");

		for (int i : sq)
			System.out.print(i + " ");

		System.out.println();

		for (int i = 0; i < n / 2; i ++)
			System.out.print(points.get(i).ind + " ");
	}

	double len(double x1, double y1, double x2, double y2) {
		return Math.sqrt((y1 - y2) * (y1 - y2) + (x1 - x2) * (x1 - x2));
	}

	boolean compare(double a, double b) {
		final double EPS = 1e-7;
		return Math.abs(a - b) < EPS;
	}

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

	BufferedReader in;
	StringTokenizer tokenizer;

	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			tokenizer = null;
			Solution();
			in.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

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

	String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens())
			tokenizer = new StringTokenizer(in.readLine());
		return tokenizer.nextToken();
	}
}


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

public class D implements Runnable {

	class Point {
		int x, y;

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

	final int n = 8;
	boolean[] used;
	Point[] points;
	int[] p;

	private void Solution() throws IOException {
		points = new Point[n];
		used = new boolean[n];
		p = new int[n];

		for (int i = 0; i < n; i++) {
			int x = nextInt(), y = nextInt();
			points[i] = new Point(x, y);
		}

		rec(0);

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

	void rec(int k) {
		for (int i = 0; i < n; i++) {
			if (!used[i]) {
				p[k] = i;
				used[i] = true;
				rec(k + 1);
				used[i] = false;
			}
		}
		if (k == n) {
			int[] sq = new int[n / 2];
			int[] rect = new int[n / 2];
			Point[] square = new Point[n / 2];
			Point[] rectangle = new Point[n / 2];

			for (int i = 0; i < n / 2; i++)
				sq[i] = p[i];

			for (int i = 0; i < n / 2; i++)
				rect[i] = p[i + 4];

			for (int i = 0; i < n / 2; i++)
				square[i] = points[sq[i]];

			for (int i = 0; i < n / 2; i++)
				rectangle[i] = points[rect[i]];

			if (isRectangle(rectangle) && isSquare(square)) {
				System.out.println("YES");
				printMas(sq);
				printMas(rect);
				System.exit(0);
			}
		}
		return;
	}

	boolean isRectangle(Point... p) {
		int x1 = p[0].x, y1 = p[0].y;
		int x2 = p[1].x, y2 = p[1].y;
		int x3 = p[2].x, y3 = p[2].y;
		int x4 = p[3].x, y4 = p[3].y;
		double a1 = len(x1, y1, x2, y2);
		double a2 = len(x2, y2, x3, y3);
		double a3 = len(x3, y3, x4, y4);
		double a4 = len(x4, y4, x1, y1);
		double c1 = Math.sqrt(a1 * a1 + a2 * a2);
		double c2 = len(x1, y1, x3, y3);
		return compare(a1, a2) && compare(a1, a3) && compare(a1, a4) && compare(c1, c2);
	}

	boolean isSquare(Point... p) {
		int x1 = p[0].x, y1 = p[0].y;
		int x2 = p[1].x, y2 = p[1].y;
		int x3 = p[2].x, y3 = p[2].y;
		int x4 = p[3].x, y4 = p[3].y;
		double a1 = len(x1, y1, x2, y2);
		double a2 = len(x2, y2, x3, y3);
		double a3 = len(x3, y3, x4, y4);
		double a4 = len(x4, y4, x1, y1);
		double c1 = Math.sqrt(a1 * a1 + a2 * a2);
		double c2 = len(x1, y1, x3, y3);
		return compare(a1, a3) && compare(a2, a4) && compare(c1, c2);
	}

	double len(double x1, double y1, double x2, double y2) {
		return Math.sqrt((y1 - y2) * (y1 - y2) + (x1 - x2) * (x1 - x2));
	}

	boolean compare(double a, double b) {
		final double EPS = 1e-7;
		return Math.abs(a - b) < EPS;
	}

	void printMas(int[] mas) {
		for (int i = 0; i < mas.length; i++) {
			System.out.print(mas[i]+1);
			if (i == mas.length - 1)
				System.out.println();
			else
				System.out.print(" ");
		}
	}

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

	BufferedReader in;
	StringTokenizer tokenizer;

	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			tokenizer = null;
			Solution();
			in.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(0);
		}
	}

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

	String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens())
			tokenizer = new StringTokenizer(in.readLine());
		return tokenizer.nextToken();
	}
}


import java.util.Scanner;

public class D97 {

    public static P[] p = new P[8];

    private static boolean storoniravni(int a, int b, int c) {
        int aa = (p[a].x - p[b].x)*(p[a].x - p[b].x) + (p[a].y - p[b].y)*(p[a].y - p[b].y);
        int bb = (p[b].x - p[c].x)*(p[b].x - p[c].x) + (p[b].y - p[c].y)*(p[b].y - p[c].y);
        int cc = (p[a].x - p[c].x)*(p[a].x - p[c].x) + (p[a].y - p[c].y)*(p[a].y - p[c].y);
        if (aa==bb || aa==cc || bb==cc)
            return true;
        else
            return false;
    }

    public static class P{
        public int x,y;
        public P(int a, int b) {x=a; y=b;}
    }

    private static boolean square(int[] pp)
    {
        if (!rect(pp))
            return false;
        if (storoniravni(pp[0],pp[1],pp[2]))
            return true;
        return false;
    }

    private static boolean rect(int[] pp)
    {
        if (normal(pp[0],pp[1],pp[2]) && normal(pp[0],pp[1],pp[3]) && normal(pp[1],pp[2],pp[3]) && normal(pp[0],pp[2],pp[3]))
            return true;
        return false;
    }

    private static boolean normal (int a, int b, int c)
    {
        if ( (p[b].x-p[a].x)*(p[c].x-p[a].x)+(p[b].y-p[a].y)*(p[c].y-p[a].y) == 0 )
            return true;
        if ( (p[a].x-p[b].x)*(p[c].x-p[b].x)+(p[a].y-p[b].y)*(p[c].y-p[b].y) == 0 )
            return true;
        if ( (p[b].x-p[c].x)*(p[a].x-p[c].x)+(p[b].y-p[c].y)*(p[a].y-p[c].y) == 0 )
            return true;
        return false;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < 8; ++i)
            p[i] = new P(sc.nextInt(),sc.nextInt());

        for (int i = 1; i < 256; ++i)
        {
            int ed[] = new int[8];
            int zer[] = new int[8];
            int k = 0, m = 0;
            for (int j = 0; j < 8; ++j)
                if ( (i & (1<<j)) == (1<<j) )
                {
                    ed[k] = j;
                    k++;
                }
                else
                {
                   zer[m] = j;
                   m++;
                }

            if (k == 4)
                if (square(ed) && rect(zer))
                {
                    System.out.println("YES");
                    for (int j = 0; j < 4; ++j)
                        System.out.print(ed[j]+1+" ");

                    System.out.println();
                    for (int j = 0; j < 4; ++j)
                        System.out.print(zer[j]+1+" ");

                    System.exit(0);
                }
        }

        System.out.print("NO");

    }
}


import java.util.Scanner;

public class D97 {

    public static P[] p = new P[8];

    private static boolean storoniravni(int a, int b, int c) {
        int aa = (p[a].x - p[b].x)*(p[a].x - p[b].x) + (p[a].y - p[b].y)*(p[a].y - p[b].y);
        int bb = (p[b].x - p[c].x)*(p[b].x - p[c].x) + (p[b].y - p[c].y)*(p[b].y - p[c].y);
        int cc = (p[a].x - p[c].x)*(p[a].x - p[c].x) + (p[a].y - p[c].y)*(p[a].y - p[c].y);
        if (aa==bb || aa==cc || bb==cc)
            return true;
        else
            return false;
    }

    public static class P{
        public int x,y;
        public P(int a, int b) {x=a; y=b;}
    }

    private static boolean square(int[] pp)
    {
        if (!rect(pp))
            return false;
        if (storoniravni(pp[0],pp[1],pp[2]))
            return true;
        return false;
    }

    private static boolean rect(int[] pp)
    {
        if (normal(pp[0],pp[1],pp[2]) && normal(pp[0],pp[1],pp[3]) && normal(pp[1],pp[2],pp[3]) && normal(pp[0],pp[2],pp[3]))
            return true;
        return false;
    }

    private static boolean normal (int a, int b, int c)
    {
        if ( (p[b].x-p[a].x)*(p[c].x-p[a].x)+(p[b].y-p[a].y)*(p[c].y-p[a].y) == 0 )
            return true;
        if ( (p[a].x-p[b].x)*(p[c].x-p[b].x)+(p[a].y-p[b].y)*(p[c].y-p[b].y) == 0 )
            return true;
        if ( (p[b].x-p[c].x)*(p[a].x-p[c].x)+(p[b].y-p[c].y)*(p[a].y-p[c].y) == 0 )
            return true;
        return false;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < 8; ++i)
            p[i] = new P(sc.nextInt(),sc.nextInt());

        for (int i = 1; i < 256; ++i)
        {
            int ed[] = new int[8];
            int zer[] = new int[8];
            int k = 0, m = 0;
            for (int j = 0; j < 8; ++j)
                if ( (i & (1<<j)) == (1<<j) )
                {
                    ed[k] = j;
                    k++;
                }
                else
                {
                   zer[m] = j;
                   m++;
                }

            if (k == 4)
                if (square(ed) && rect(zer))
                {
                    System.out.println("YES");
                    for (int j = 0; j < 4; ++j)
                        System.out.print(ed[j]+1+" ");

                    System.out.println();
                    for (int j = 0; j < 4; ++j)
                        System.out.print(zer[j]+1+" ");

                    System.exit(1);
                }
        }

        System.out.print("NO");

    }
}


import java.util.*;
import java.io.*;
public class a {
    static long mod = 1000000009;
    static char[][] res;
public static void main(String[] args) throws IOException
{
    //Scanner input = new Scanner(new File("input.txt"));
    //PrintWriter out = new PrintWriter(new File("output.txt"));
  input.init(System.in);
  PrintWriter out  = new PrintWriter((System.out));
  xs = new int[8]; ys = new int[8];
  String[] orders = {"0123","0132","0213","0231","0312","0321",
          "1023","1032","1203","1230","1302","1320",
          "2013","2031","2103","2130","2301","2310",
          "3012","3021","3102","3120","3201","3210"};
  for(int i = 0; i<8; i++)
  {
      xs[i] = input.nextInt();
      ys[i] = input.nextInt();
  }
  boolean found = false;
  for(int i = 0; i<8; i++)
      for(int j = 0; j<8; j++)
          for(int k = 0; k<8; k++)
              for(int l = 0; l<8; l++)
              {
                  if(i==j||i==k||i==l||j==k||j==l||k==l) continue;
                  int[] first = {i,j,k,l};
                  ArrayList<Integer> secondlist = new ArrayList<Integer>();
                  for(int m = 0; m<8; m++)
                      if(m != i && m != j && m != k && m != l) secondlist.add(m);
                  int[] second = new int[4];
                  for(int m = 0; m<4; m++)
                  {
                      second[m] = secondlist.get(m);
                  }
                  for(int x = 0; x<24; x++)
                  {
                      if(found) break;
                      for(int y = 0; y<24; y++)
                      {
                          int[] sortedx = new int[4];
                          for(int z = 0; z<4; z++)
                              sortedx[z] = first[orders[x].charAt(z)-'0'];
                          int[] sortedy = new int[4];
                          for(int z = 0; z<4; z++)
                              sortedy[z] = second[orders[y].charAt(z)-'0'];
                          int dist = dist(sortedx[0], sortedx[1]);
                          if(dist != dist(sortedx[1], sortedx[2])) continue;
                          if(dist != dist(sortedx[3], sortedx[2])) continue;
                          if(dist != dist(sortedx[0], sortedx[3])) continue;
                          if(dist + dist != dist(sortedx[0], sortedx[2])) continue;
                          int dist1 = dist(sortedy[0], sortedy[1]), dist2 = dist(sortedy[2], sortedy[1]);
                          if(dist1 != dist(sortedy[2], sortedy[3])) continue;
                          if(dist2 != dist(sortedy[3], sortedy[0])) continue;
                          if(dist1+dist2 != dist(sortedy[0], sortedy[2])) continue;
                          found = true;
                          out.println("YES");
                          for(int xx: sortedx) out.print((xx+1)+" ");
                          out.println();
                          for(int yy: sortedy) out.print((yy+1)+" ");
                          break;
                      }
                      if(found) break;
                  }
                  if(found) break;
              }
  if(!found) out.println("NO");
  out.close();
}
static int[] xs, ys;
static int dist(int a, int b)
{
    return (xs[a]-xs[b])*(xs[a]-xs[b]) + (ys[a]-ys[b])*(ys[a]-ys[b]);
}
static long pow(long x, long p)
{
    if(p==0) return 1;
    if((p&1) > 0)
    {
        return (x*pow(x, p-1))%mod;
    }
    long sqrt = pow(x, p/2);
    return (sqrt*sqrt)%mod;
}
static long gcd(long a, long b)
{
    if(b==0) return a;
    return gcd(b, a%b);
}
static class input {
  static BufferedReader reader;
  static StringTokenizer tokenizer;

  /** call this method to initialize reader for InputStream */
  static void init(InputStream input) {
      reader = new BufferedReader(
                   new InputStreamReader(input) );
      tokenizer = new StringTokenizer("");
  }

  /** get next word */
  static String next() throws IOException {
      while ( ! tokenizer.hasMoreTokens() ) {
          //TODO add check for eof if necessary
          tokenizer = new StringTokenizer(
                 reader.readLine() );
      }
      return tokenizer.nextToken();
  }

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

  static double nextDouble() throws IOException {
      return Double.parseDouble( next() );
  }
  static long nextLong() throws IOException {
      return Long.parseLong( next() );
  }
  static String nextLine() throws IOException {
    return reader.readLine();
  }
}
/*
Sum Interval Tree - uses O(n) space
Updates and queries over a range of values in log(n) time
Note: If querying all elements, use difference array instead.
*/
static class IT
{
    int[] left,right, val, a, b;
    IT(int n)
    {
        left = new int[4*n];
        right = new int[4*n];
        val = new int[4*n];
        a = new int[4*n];
        b = new int[4*n];
        init(0,0, n);
    }
    int init(int at, int l, int r)
    {
        a[at] = l;
        b[at] = r;
        if(l==r)
            left[at] = right [at] = -1;
        else
        {
            int mid = (l+r)/2;
            left[at] = init(2*at+1,l,mid);
            right[at] = init(2*at+2,mid+1,r);
        }
        return at++;
    }
    //return the sum over [x,y]
    int get(int x, int y)
    {
        return go(x,y, 0);
    }
    int go(int x,int y, int at)
    {
        if(at==-1) return 0;
        if(x <= a[at] && y>= b[at]) return val[at];
        if(y<a[at] || x>b[at]) return 0;
        return go(x, y, left[at]) + go(x, y, right[at]);
    }
    //add v to elements x through y
    void add(int x, int y, int v)
    {
        go3(x, y, v, 0);
    }
    void go3(int x, int y, int v, int at)
    {
        if(at==-1) return;
        if(y < a[at] || x > b[at]) return;
        val[at] += (Math.min(b[at], y) - Math.max(a[at], x) + 1)*v;
        go3(x, y, v, left[at]);
        go3(x, y, v, right[at]);
    }
}
}


import java.awt.Point;
import java.io.BufferedInputStream;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class RectangleAndSquare { //Round #97 - Rectangle and Square
	public static void main(String[] args) {
		Scanner sc = new Scanner(new BufferedInputStream(System.in));

		Point[] points = new Point[8];
		for(int i = 0; i < points.length; i++) {
			points[i] = new Point(sc.nextInt(), sc.nextInt());
		}

		boolean possible = false;

		outer:
		for(int i = 0; i <= 255; i++) {
			String binaryStr = Integer.toString(i, 2);
			while(binaryStr.length() < 8) {
				binaryStr = "0" + binaryStr;
			}

			int oneCount = 0;
			for(int j = 0; j < binaryStr.length(); j++) {
				if(binaryStr.charAt(j) == '1') {
					oneCount++;
				}
			}

			if(oneCount == 4) {
				Point[] squarePoints = new Point[4];
				Point[] rectanglePoints = new Point[4];
				int[] squareIndices = new int[4];
				int[] rectangleIndices = new int[4];
				int squareIndex = 0;
				int rectangleIndex = 0;

				for(int j = 0; j < binaryStr.length(); j++) {
					if(binaryStr.charAt(j) == '1') {
						squarePoints[squareIndex] = points[j];
						squareIndices[squareIndex] = j + 1;
						squareIndex++;
					} else {
						rectanglePoints[rectangleIndex] = points[j];
						rectangleIndices[rectangleIndex] = j + 1;
						rectangleIndex++;
					}
				}

				if(isPossible(squarePoints, rectanglePoints)) {
					System.out.println("YES");

					for(int k = 0; k < squareIndices.length - 1; k++) {
						System.out.print(squareIndices[k] + " ");
					}
					System.out.println(squareIndices[squareIndices.length - 1]);

					for(int k = 0; k < rectangleIndices.length - 1; k++) {
						System.out.print(rectangleIndices[k] + " ");
					}
					System.out.println(rectangleIndices[rectangleIndices.length - 1]);

					possible = true;
					break outer;
				}
			}
		}

		if(!possible) {
			System.out.println("NO");
		}
	}

	private static boolean isPossible(Point[] squarePoints, Point[] rectanglePoints) {
		final int SQUARE = 0;
		for(int whichShape = 0; whichShape < 2; whichShape++) {
			Point[] pointArray;
			if(whichShape == SQUARE) {
				pointArray = squarePoints;
			} else {
				pointArray = rectanglePoints;
			}

			sortPoints(pointArray);

			double[] dists = new double[4];
			for(int i = 0; i < 4; i++) {
				dists[i] = pointArray[i].distance(pointArray[(i + 1) % 4]);
			}

			if(whichShape == SQUARE) {
				if(!(dists[0] == dists[1] && dists[1] == dists[2] && dists[2] == dists[3])) {
					return false;
				}
			} else {
				if(!(dists[0] == dists[2] && dists[1] == dists[3])) {
					return false;
				}
			}

			double[] angles = new double[4];
			for(int i = 0; i < 4; i++) {
				angles[i] = angleBetweenLines(pointArray[(i + 1) % 4], pointArray[i], pointArray[(i + 2) % 4]);

				final double EPS = 10e-6;

				if(!(Math.abs(Math.abs(angles[i]) - 90) < EPS || Math.abs(Math.abs(angles[i]) - 270) < EPS)) {
					return false;
				}
			}
		}

		return true;
	}

	/**
	 * @return The angle in degrees between the two lines starting from commonPoint and going to each of the other two points respectively.
	 */
	private static double angleBetweenLines(Point commonPoint, Point lineOneEndPoint, Point lineTwoEndPoint) {
		lineOneEndPoint = new Point(lineOneEndPoint);
		lineOneEndPoint.translate(-commonPoint.x, -commonPoint.y);

		lineTwoEndPoint = new Point(lineTwoEndPoint);
		lineTwoEndPoint.translate(-commonPoint.x, -commonPoint.y);

		double angle = Math.atan2(lineTwoEndPoint.y, lineTwoEndPoint.x) - Math.atan2(lineOneEndPoint.y, lineOneEndPoint.x);

		return Math.toDegrees(angle);
	}

	/**
	 * Sorts points counter-clockwise on their angle with the point with the lowest y coordinate.
	 */
	private static void sortPoints(Point[] points) {
		//Find the point with the lowest y coordinate (and lowest x coordinate if it's a tie)
		Point lowestYPoint = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE);
		for(int i = 0; i < points.length; i++) {
			Point p = points[i];
			if(p.y < lowestYPoint.y) {
				lowestYPoint = p;
			} else if(p.y == lowestYPoint.y && p.x < lowestYPoint.x) {
				lowestYPoint = p;
			}
		}

		final Point point0 = lowestYPoint;
		Comparator<Point> counterClockwiseSorter = new Comparator<Point>() {
			public int compare(Point point1, Point point2) {
				int side = sideOfLine(point2, point0, point1);

				if(side == 0) {
					if(point1.distanceSq(point0) > point2.distanceSq(point0)) {
						return 1;
					} else if(point1.distanceSq(point0) == point2.distanceSq(point0)) {
						return 0;
					} else {
						return -1;
					}
				} else {
					return -side;
				}
			}
		};

		Arrays.sort(points, counterClockwiseSorter);
	}

	public static int sideOfLine(Point p, Point line1, Point line2) {
		return (line2.x - line1.x) * (p.y - line1.y) - (p.x - line1.x) * (line2.y - line1.y);
	}
}


import java.awt.Point;
import java.io.BufferedInputStream;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class RectangleAndSquare { //Round #97 - Rectangle and Square
	public static void main(String[] args) {
		Scanner sc = new Scanner(new BufferedInputStream(System.in));

		Point[] points = new Point[8];
		for(int i = 0; i < points.length; i++) {
			points[i] = new Point(sc.nextInt(), sc.nextInt());
		}

		boolean possible = false;

		outer:
		for(int i = 0; i <= 256; i++) {
			String binaryStr = Integer.toString(i, 2);
			while(binaryStr.length() < 8) {
				binaryStr = "0" + binaryStr;
			}

			int oneCount = 0;
			for(int j = 0; j < binaryStr.length(); j++) {
				if(binaryStr.charAt(j) == '1') {
					oneCount++;
				}
			}

			if(oneCount == 4) {
				Point[] squarePoints = new Point[4];
				Point[] rectanglePoints = new Point[4];
				int[] squareIndices = new int[4];
				int[] rectangleIndices = new int[4];
				int squareIndex = 0;
				int rectangleIndex = 0;

				for(int j = 0; j < binaryStr.length(); j++) {
					if(binaryStr.charAt(j) == '1') {
						squarePoints[squareIndex] = points[j];
						squareIndices[squareIndex] = j + 1;
						squareIndex++;
					} else {
						rectanglePoints[rectangleIndex] = points[j];
						rectangleIndices[rectangleIndex] = j + 1;
						rectangleIndex++;
					}
				}

				if(isPossible(squarePoints, rectanglePoints)) {
					System.out.println("YES");

					for(int k = 0; k < squareIndices.length - 1; k++) {
						System.out.print(squareIndices[k] + " ");
					}
					System.out.println(squareIndices[squareIndices.length - 1]);

					for(int k = 0; k < rectangleIndices.length - 1; k++) {
						System.out.print(rectangleIndices[k] + " ");
					}
					System.out.println(rectangleIndices[rectangleIndices.length - 1]);

					possible = true;
					break outer;
				}
			}
		}

		if(!possible) {
			System.out.println("NO");
		}
	}

	private static boolean isPossible(Point[] squarePoints, Point[] rectanglePoints) {
		sortPoints(squarePoints);
		sortPoints(rectanglePoints);

		double distOne = squarePoints[0].distance(squarePoints[1]);
		double distTwo = squarePoints[1].distance(squarePoints[2]);
		double distThree = squarePoints[2].distance(squarePoints[3]);
		double distFour = squarePoints[3].distance(squarePoints[0]);

		if(!(distOne == distTwo && distTwo == distThree && distThree == distFour)) {
			return false;
		}

		distOne = rectanglePoints[0].distance(rectanglePoints[1]);
		distTwo = rectanglePoints[1].distance(rectanglePoints[2]);
		distThree = rectanglePoints[2].distance(rectanglePoints[3]);
		distFour = rectanglePoints[3].distance(rectanglePoints[0]);

		if(!(distOne == distThree && distTwo == distFour)) {
			return false;
		}

		return true;
	}

	private static Point point0;

	private static void sortPoints(Point[] points) {
		//Find the point with the lowest y coordinate (and lowest x coordinate if it's a tie)
		point0 = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE);
		for(int i = 0; i < points.length; i++) {
			Point p = points[i];
			if(p.y < point0.y) {
				point0 = p;
			} else if(p.y == point0.y && p.x < point0.x) {
				point0 = p;
			}
		}

		/** Sorts points counter-clockwise on their angle with point0 */
		Comparator<Point> counterClockwiseSorter = new Comparator<Point>() {
			public int compare(Point point1, Point point2) {
				int side = sideOfLine(point2, point0, point1);

				if(side == 0) {
					if(point1.distanceSq(point0) > point2.distanceSq(point0)) {
						return 1;
					} else if(point1.distanceSq(point0) == point2.distanceSq(point0)) {
						return 0;
					} else {
						return -1;
					}
				} else {
					return -side;
				}
			}
		};

		Arrays.sort(points, counterClockwiseSorter);
	}

	public static int sideOfLine(Point p, Point line1, Point line2) {
		return (line2.x - line1.x) * (p.y - line1.y) - (p.x - line1.x) * (line2.y - line1.y);
	}
}


//package beta97;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class D
{
	public static BufferedReader br;
	public static StringTokenizer inp;
	public static PrintWriter out;
	static int x[], y[];
	static double eps = 1e-8;
	public static void main(String[] args)  throws IOException
	{

		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);

		x = new int[8]; y = new int[8];
		for(int i = 0 ; i < 8 ; i++)
		{
			inp = new StringTokenizer(br.readLine());
			x[i] = nextInt();
			y[i] = nextInt();
		}

		boolean no = true;
		int ind[] = new int[4];
		for(ind[0] = 0 ; ind[0] < 8 ; ind[0]++)
		{
			for(ind[1] = ind[0]+1 ; ind[1] < 8 ; ind[1]++)
			{
				for(ind[2] = ind[1]+1 ; ind[2] < 8 ; ind[2]++)
				{
					for(ind[3] = ind[2]+1 ; ind[3] < 8 ; ind[3]++)
					{

						if(checkSq(ind))
						{
							int rect = 0;
							for(int i = 0 ; i < 4 ; i++)rect|=1<<ind[i];
							int ind2[] = new int[4];
							int j = 0;
							for(int i = 0 ; i < 8 ; i++)
							{
								if(((1<<i)&rect)==0)
								{
									ind2[j++] = i;
								}
							}

							if(checkRect(ind2))
							{
								System.out.println("YES");
								print(ind, ind2);
								no = false;
								ind[0] = ind[1]= ind[2] = ind[3] = 9;
							}
						}
					}
				}
			}

		}

		if(no)System.out.println("NO");

		br.close();
		out.close();
	}

	public static boolean checkSq(int ind[])
	{
		int ii[] = sort(ind);
		if(!checkRect(ind))return false;
		if(Math.abs(Math.sqrt((x[ii[0]] - x[ii[1]])*(x[ii[0]] - x[ii[1]]) + (y[ii[0]] - y[ii[1]])*(y[ii[0]] - y[ii[1]]))   -
					Math.sqrt((x[ii[2]] - x[ii[1]])*(x[ii[2]] - x[ii[1]]) + (y[ii[2]] - y[ii[1]])*(y[ii[2]] - y[ii[1]])))
				< eps)return true;
		return false;
	}
	public static boolean checkRect(int ind[])
	{
		int ii[] = sort(ind);
		for(int i= 1 ; i < 4 ; i++)
		{
			if(!isStaple( x[ii[i-1]] , y[ii[i-1]], x[ii[i]], y[ii[i]], x[ii[(i+1)%4]], y[ii[(i+1)%4]]))
				return false;
		}
		return true;
	}

	public static boolean isStaple(int a, int b, int c , int d, int e, int f)
	{
		if(a==c && d==f || b==d&& c==e)return true;

		if(Math.abs((double)(b-d)*(d-f)/((a-c)*(c-e)) + 1) < eps )return true;

		return false;
	}

	public static int[] sort(int ind[])
	{
		int ll=0;
		int ind2[] = new int[4];
		for(int i = 1 ; i < 4 ;i++)
		{
			if(y[ind[i]] < y[ind[ll]])
				ll = i;
			else if(y[ind[i]] == y[ind[ll]])
			{
				if(x[ind[i]] < x[ind[ll]])ll = i;
			}
		}
		ind2[0] = ind[ll];

		ll=0;
		for(int i = 1 ; i < 4 ;i++)
		{
			if(x[ind[i]] < x[ind[ll]])
				ll = i;
			else if(x[ind[i]] == x[ind[ll]])
			{
				if(y[ind[i]] > y[ind[ll]])ll = i;
			}
		}
		ind2[1] = ind[ll];

		ll=0;
		for(int i = 1 ; i < 4 ;i++)
		{
			if(y[ind[i]] > y[ind[ll]])
				ll = i;
			else if(y[ind[i]] == y[ind[ll]])
			{
				if(x[ind[i]] > x[ind[ll]])ll = i;
			}
		}
		ind2[2] = ind[ll];

		ll=0;
		for(int i = 1 ; i < 4 ;i++)
		{
			if(x[ind[i]] >  x[ind[ll]])
				ll = i;
			else if(x[ind[i]] == x[ind[ll]])
			{
				if(y[ind[i]] < y[ind[ll]])ll = i;
			}
		}
		ind2[3] = ind[ll];

		return ind2;
	}

	public static void print(int ind1[], int ind2[])
	{
		System.out.println((ind1[0]+1) + " " + (ind1[1]+1) + " " +  (ind1[2]+1) + " " + (ind1[3]+1));
		System.out.println((ind2[0]+1) + " " + (ind2[1]+1) + " " +  (ind2[2]+1) + " " + (ind2[3]+1));
	}

	public static int nextInt(){return Integer.parseInt(inp.nextToken());}
	public static long nextLong(){return Long.parseLong(inp.nextToken());}
	public static double nextDouble(){return Double.parseDouble(inp.nextToken());}
	public static String next(){return inp.nextToken();}

}


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],rect) == slope(points, rect[2],
                    rect[3],rect))
                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[3]) == d
                && calcul(points, square[2], square[3]) == d) {
            if (slope(points, square[0], square[1],square)
                    * slope(points, square[1], square[2],square)+1 > 0.000001||slope(points, square[0], square[1],square)
                    ==0&& slope(points, square[1], square[2],square)==Double.MAX_VALUE||slope(points, square[0], square[1],square)==0
                            && slope(points, square[1], square[2],square)==0)
                return true;
        }
        return false;
    }

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

            return s;
        }
        return Double.MAX_VALUE;
    }

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

        int d = (points[i].i - points[j].i) * (points[i].i - points[j].i)
                + (points[i].j - points[j].j) * (points[i].j - points[j].j);

        return d;

    }

    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 = rect;
                r = square;
                return true;
            }
        }

        return false;
    }

    private static boolean checksquare(int[] rect, point[] points) {
        long d1 = calcul(points, rect[0], rect[1]);
        long d2 = calcul(points, rect[0], rect[2]);
        long d3 = calcul(points, rect[1], rect[2]);
        long d4 = calcul(points, rect[1], rect[3]);
        long d5 = calcul(points, rect[2], rect[3]);
        long d6 = calcul(points, rect[0], rect[3]);
        if (d1 == d2 && d1 == d4 && d1 == d5 && d3 == d6 && d1 + d2 == d3)
        {
                return true;
        }
        else
            return false;

    }

    private static boolean checkRect(int[] square, point[] points) {
        long d1 = calcul(points, square[0], square[1]);
        long d2 = calcul(points, square[0], square[2]);
        long d3 = calcul(points, square[1], square[2]);
        long d4 = calcul(points, square[1], square[3]);
        long d5 = calcul(points, square[2], square[3]);
        long d6 = calcul(points, square[0], square[3]);
        if (d1 == d5 && d2 == d4 && d3 == d6 && d1 + d2 == d3)
        {

            return true;
        }else
            return false;
    }

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

        long d = (points[i].i - points[j].i) * (points[i].i - points[j].i)
                + (points[i].j - points[j].j) * (points[i].j - points[j].j);

        return d;

    }

    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;
        }

        public String toString()
        {
            return "("+j+" "+i+")";
        }
    }

}


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 = rect;
            r = square;
            return true;
        } else {
            check1 = checksquare(rect, points);
            check2 = checkRect(square, points);
            if (check1 && check2) {
                s = rect;
                r = square;
                return true;
            }
        }

        return false;
    }

    private static boolean checkRect(int[] rect, point[] points) {
        long d1 = calcul(points, rect[0], rect[1]);
        long d2 = calcul(points, rect[0], rect[2]);
        long d3 = calcul(points, rect[1], rect[2]);
        long d4 = calcul(points, rect[1], rect[3]);
        long d5 = calcul(points, rect[2], rect[3]);
        long d6 = calcul(points, rect[0], rect[3]);
        if (d1 == d2 && d1 == d4 && d1 == d5 && d3 == d6 && d1 + d2 == d3)
            return true;
        else
            return false;

    }

    private static boolean checksquare(int[] square, point[] points) {
        long d1 = calcul(points, square[0], square[1]);
        long d2 = calcul(points, square[0], square[2]);
        long d3 = calcul(points, square[1], square[2]);
        long d4 = calcul(points, square[1], square[3]);
        long d5 = calcul(points, square[2], square[3]);
        long d6 = calcul(points, square[0], square[3]);
        if (d1 == d5 && d2 == d4 && d3 == d6 && d1 + d2 == d3)
            return true;
        else
            return false;
    }

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

        long d = (points[i].i - points[j].i) * (points[i].i - points[j].i)
                + (points[i].j - points[j].j) * (points[i].j - points[j].j);

        return d;

    }

    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],rect) == slope(points, rect[2],
                    rect[3],rect))
                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[3]) == d
                && calcul(points, square[2], square[3]) == d) {
            if (slope(points, square[0], square[1],square)
                    * slope(points, square[1], square[2],square)+1 > 0.000001||slope(points, square[0], square[1],square)
                    ==0&& slope(points, square[1], square[2],square)==Double.MAX_VALUE||slope(points, square[0], square[1],square)==0
                            && slope(points, square[1], square[2],square)==0)
                return true;
        }
        return false;
    }

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

            return s;
        }
        return Double.MAX_VALUE;
    }

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

        int d = (points[i].i - points[j].i) * (points[i].i - points[j].i)
                + (points[i].j - points[j].j) * (points[i].j - points[j].j);

        return d;

    }

    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) {
        long d1 = calcul(points, rect[0], rect[1]);
        long d2 = calcul(points, rect[0], rect[2]);
        long d3 = calcul(points, rect[1], rect[2]);
        long d4 = calcul(points, rect[1], rect[3]);
        long d5 = calcul(points, rect[2], rect[3]);
        long d6 = calcul(points, rect[0], rect[3]);
        if (d1 == d2 && d1 == d4 && d1 == d5 && d3 == d6 && d1 + d2 == d3)
            return true;
        else
            return false;

    }

    private static boolean checksquare(int[] square, point[] points) {
        long d1 = calcul(points, square[0], square[1]);
        long d2 = calcul(points, square[0], square[2]);
        long d3 = calcul(points, square[1], square[2]);
        long d4 = calcul(points, square[1], square[3]);
        long d5 = calcul(points, square[2], square[3]);
        long d6 = calcul(points, square[0], square[3]);
        if (d1 == d5 && d2 == d4 && d3 == d6 && d1 + d2 == d3)
            return true;
        else
            return false;
    }

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

        long d = (points[i].i - points[j].i) * (points[i].i - points[j].i)
                + (points[i].j - points[j].j) * (points[i].j - points[j].j);

        return d;

    }

    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;
        }

    }

}