Number of Cycles

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

Jaehyun likes computational geometry. Here is Jaehyun's question: "We are given nn segments on the Cartesian plane. Count the number of simple cycles in the generated graph."

Formally, a set of nn segments S=s_1,s_2,,s_nS = \\{s\_1, s\_2, \ldots, s\_n\\} generates the following graph G=(V,E)G = (V, E).

For a point vv of the plane, vVv \in V if vv is one of the endpoints of the segments or vv is an intersection of two or more segments.

For two distinct vertices uu and vv, (u,v)E(u, v) \in E if there is a segment s_iSs\_i \in S containing vertices uu and vv, and there is no vertex on s_is\_i between uu and vv.

A simple cycle is a cycle with no repeated vertices or edges.

Zigui tried to solve Jaehyun's problem, and he found it is possible to make various answers with just a few segments. 

For given NN, find a set of segments such that the number of simple cycles in the graph generated by these segments is NN.

입력

The first line contains an integer NN (1N10001 \le N \le 1000).

출력

The first line of the output must contain an integer KK: the number of segments (1K121 \le K \le 12).

Each of the next KK lines must contain four integers x_1x\_{1}, y_1y\_{1}, x_2x\_{2}, and y_2y\_{2} denoting a segment with endpoints (x_1,y_1)(x\_{1}, y\_{1}) and (x_2,y_2)(x\_{2}, y\_{2}) (109x_1,y_1,x_2,y_2109-10^{9} \le x\_{1}, y\_{1}, x\_{2}, y\_{2} \le 10^{9}, (x_1,y_1)(x_2,y_2)(x\_{1}, y\_{1}) \neq (x\_{2}, y\_{2})).