Phalanx
Before the grand battle, the renowned commander Sandro decided to organize his army into a strategic formation. Sandro's army is composed of (N^2) warriors, each possessing a unique strength represented by an integer from (1) to (N^2). All warriors have distinct strengths. After careful consideration, Sandro opted to arrange his warriors into a phalanx consisting of (N) rows, with (N) warriors in each row.
Sandro's strategy includes several key objectives:
1. To protect the strongest warriors, any warrior not in the last row must have a stronger warrior directly behind him. 2. Acknowledging that the enemy's main forces are concentrated on the left flank, any warrior with a neighbor to the right must have a stronger neighbor. 3. To keep the true strength of his army hidden until the battle commences, the sum of the strengths of the warriors positioned on the perimeter of the phalanx should be minimized.
Input
The input consists of a single line containing a natural number (N) ((1 N 100)).
Output
The output should present the phalanx arrangement in (N) rows, each containing (N) numbers. Each row corresponds to a row in the phalanx, where the (j)-th number in the (i)-th row represents the strength of the warrior positioned (j)-th from the left in the (i)-th row. If there are multiple valid configurations, you may output any one of them.