eolymp
bolt
Try our new interface for solving problems
Problems

Convex hull of the 3D - 3

Convex hull of the 3D - 3

Given n points in space. No 4 points do not lie in one plane. Find the convex hull of these points.

Input

The first line contains the number n (4 ≤ n ≤ 100). Further, the n rows are given by three numbers - the coordinates of points. All coordinates are integers, do not exceed 500.

Output

In the first line of the output number of edges m. Coming up next m lines output description of the faces: the number of vertices and number of points in the original set. The points are numbered in the order in which they are given in the input file. Points within the faces must be sorted in order of counterclockwise relative to the outer normal to the face.

Time limit 2 seconds
Memory limit 256 MiB
Input example #1
4
0 0 0
1 0 0
0 1 0
0 0 1
Output example #1
4
3 0 1 3
3 0 2 1
3 0 3 2
3 1 2 3
Author Stanislav Pak
Source Winter School, Kharkov, 2011, Day 1