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

Input

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

Output

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

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

Examples

Input

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


Output

YES
5 6 7 8
1 2 3 4


Input

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


Output

NO


Input

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


Output

YES
1 2 3 4
5 6 7 8

Note

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

Solution (in JAVA):

Solution:
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);
	}
}