Hi, I hope we aren't doing your homework. I wouldn't bother with the inner points.
I would start by calculating the lengths of all 10 lines. First make sure all the x and y values are positive (if necessary add a constant that you can remove later). The formula is simple L1,2 = ((x1-x2)^2 + (y1-y2)^2)^0.5 You should end up with two sets of 5 short lines and 5 long lines. The long lines can be ignored. Then pick the point with the greatest y value and call it "A". If there are two with equal and highest y values call the one (of those two) with the smallest x value "A". The hard part is over. Now look at the two short lines that attach points to "A". The point with an x value smaller than A's x value is "E", the other point is "B". Now look at the short line from "B" that is NOT attached to "A". The point it attaches "B" to is "C". The only un-labled point is "D".