Sewing Graph

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

문제

Donghyun recently bought a square-shaped tablecloth. There are NN dots on the cloth, and the dots can be seen from both sides of the cloth. Donghyun thought that the tablecloth can be made more beautiful, so he decided to decorate the cloth with sewing.

For convenience, let's assume that each dot is a point on the xyxy-plane and the dots are numbered from 11 to NN. Dot ii (1iN1 \le i \le N) is placed at coordinate (x_i,y_i)(x\_i, y\_i). No two dots have the same coordinates. A sewing sequence is an integer sequence s_i\\{ s\_i \\} of length k2k \geq 2 satisfying 1s_iN1 \le s\_i \le N (1ik1 \le i \le k) and s_is_i+1s\_i \neq s\_{i+1} (1ik11 \le i \le k-1).
The sequence draws edges on the cloth per the following rules:

  • Draw an edge connecting dot s_2i1s\_{2i-1} and dot s_2is\_{2i} on the front side of the cloth for all 1ik21 \le i \le \left \lfloor \frac{k}{2} \right \rfloor.
  • Draw an edge connecting dot s_2js\_{2j} and dot s_2j+1s\_{2j+1} on the back side of the cloth for all 1jk121 \le j \le \left \lfloor \frac{k-1}{2} \right\rfloor.

Donghyun wants to make a \textbf{beautiful pattern} on the tablecloth, which is defined as the following:

  • For both sides of the cloth, all NN dots are connected by the edges on that side.
  • Two edges on the same side of the cloth can intersect only at a common endpoint.

Donghyun is very busy, so he wants to finish his sewing job as quickly as possible. In other words, over all sewing sequences that produces a beautiful pattern, Donghyun decides to choose the shortest such sequence. Your job is to find such a sequence.

Note that Donghyun wants to minimize the length of the sewing sequence itself, not the sum of the lengths of the edges he draws.

입력

On the first line, a single integer NN is given. (2N1,0002 \le N \le 1\\,000)

For each of the next NN lines, two integers x_ix\_i and y_iy\_i are given, which means dot ii is placed at coordinate (x_i,y_i)(x\_i, y\_i). (1x_i,y_i1091 \le x\_i, y\_i \le 10^9)

No two dots are at the same coordinates.

출력

On the first line, output a positive integer kk, the length of the shortest sewing sequence that produces a beautiful pattern.

On the next line, output s_1s\_1, s_2s\_2, \cdots, s_ks\_k, the actual sewing sequence.

It can be proven that, for every possible input, there exists a sewing sequence that produces a beautiful pattern.