Given points on the plane no three of which are collinear, find a permutation of the points such that the segments form a non-degenerate polygon, that is, one that does not cross itself.
Input consists of several cases, each one with followed by points with integer coordinates not larger than in absolute value. Assume , and that no three given points are collinear.
For every case, print a correct polygon constructed from the
points. If there is more than one solution, print any of them. If there
is no solution, print “Ivan is a troll”.
Input
4 0 0 1 1 0 1 1 0 3 0 0 10 10 15 20 5 -1 -1 -3 -3 -1 1 1 -2 -2 0 4 0 0 -1 1 0 -1 1 -2 7 -9 -4 0 -5 2 3 1 7 0 0 5 -5 1 4
Output
1 4 2 3 1 2 3 2 4 1 3 5 3 4 1 2 1 2 6 5 3 7 4