Figures Of Simple Sense#6442

Figures Of Simple Sense

1 second
256 megabytes
Hard

Do you think that drawing polygons is easy? That may not be the case when you have some restrictions.

In this problem, your task is to draw a polygon with exactly vertices. The polygon must not have any self-intersections, and no three consecutive vertices may be collinear. All coordinates of its vertices must be integers between and , inclusive. Easy, right?

However, there is one more restriction. The number of inner angles of this polygon that are equal to 90^\circ must be as large as possible under these constraints. What do you think about it now?

Input

The first line contains the number of test cases (1 \leq T \leq 30). Each of the following lines contains one integer (3 \leq N \leq 1000).

Output

For each test case, print the maximum possible number of inner angles equal to 90^\circ, followed by pairs of integers — the coordinates of the vertices of the polygon, in either clockwise or counterclockwise order. If there are multiple solutions, output any of them.

Examples

Example 1

Loading
Loading