K. Kind Baker
time limit per test
0.3 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

Flora loves baking cakes, and for her company's $$$K$$$-th birthday she promised to bring a special treat: a cake, with $$$K$$$ different combinations of toppings to choose from! Unfortunately, she doesn't have much time, so she needs to simplify things a bit.

A cake can be described as a $$$100 \times 100$$$ grid of square cake pieces. A collection of pieces is connected if, for every pair of pieces in the collection, they are connected directly (they share a side) or indirectly (there is a sequence of pieces such that you can go from one piece to the other through directly connected pieces). The figure below depicts two collections of pieces (only a relevant part of the grid is shown). One collection is connected, while the other one is not.

(a) Connected(b) Not connected

Flora has a machine that accepts a connected collection of cake pieces and puts a certain topping on each of those pieces. A different topping is applied each time the machine runs. After using the machine a given number of times, each piece will have a (possibly empty) combination of toppings on it. Two pieces are considered to be of different types if they have a different combination of toppings. Flora wants to know the minimum number of times she has to use the machine to achieve exactly $$$K$$$ different types of cake pieces, and a possible way to choose a connected collection of cake pieces for each time she will use the machine.

Input

The input consists of a single line that contains an integer $$$K$$$ ($$$1 \leq K \leq 4000$$$) indicating the number of different types of pieces that the cake must have.

Output

The first line must contain an integer $$$T$$$ indicating the minimum number of times that Flora has to use the machine. Each of the next $$$T$$$ lines describes a connected collection of cake pieces to drive into the machine the successive times that Flora will use it; the line must contain a positive integer $$$N$$$ followed by $$$N$$$ different pairs of integers $$${X_1,Y_1}, {X_2,Y_2}, \ldots, {X_N,Y_N}$$$ ($$$1 \le X_i,Y_i \le 100$$$ for $$${i}={1}, {2}, \ldots, {N}$$$), indicating that the collection consists of the pieces with coordinates $$${(X_1,Y_1)}, {(X_2,Y_2)}, \ldots, {(X_N,Y_N)}$$$. It is guaranteed that there exists at least one solution. The coordinates $$$(1,1)$$$ identify the square piece in any corner of the cake.

Examples
Input
6
Output
3
2 2 3 3 3
3 3 2 3 3 4 3
3 3 3 4 3 4 4
Input
2
Output
1
3 100 99 99 99 99 100
Note

The picture below explains the first sample (only a relevant part of the grid is shown). To get exactly $$$K=6$$$ combinations of toppings, Flora has to use the machine a minimum of $$$T=3$$$ times. In the picture, the first topping applied by the machine is represented as a pineapple ($$$\star$$$), the second as a cherry ($$$\rule[0.1ex]{1ex}{1ex}$$$), and the third as a blueberry ($$$\bullet$$$). The lists of pieces having each combination of toppings are as follows:

  1. Only topping $$$1$$$ ($$$\star$$$): $$$(2,3)$$$;
  2. Only topping $$$2$$$ ($$$\rule[0.1ex]{1ex}{1ex}$$$): $$$(3,2)$$$;
  3. Only topping $$$3$$$ ($$$\bullet$$$): $$$(4,4)$$$;
  4. Toppings $$$2$$$ ($$$\rule[0.1ex]{1ex}{1ex}$$$) and $$$3$$$ ($$$\bullet$$$): $$$(4,3)$$$;
  5. All three toppings: $$$(3,3)$$$;
  6. No toppings: rest of the pieces.