#CCBCHBA0000095. Logical Sequence

Logical Sequence

Logical Sequence

Source: beecrowd

Version: Phuoc Hung OJ Extended

Problem Statement

Given integer nn, for every ii from 1 to nn print two consecutive lines: ii, i2i^2, i3i^3, then ii, i2+1i^2+1, i3+1i^3+1. Separate three numbers with one space, print all digits in ordinary decimal notation.

Input

One line contains integer nn.

Output

Print exactly 2n2n lines, keeping the two lines for each ii adjacent.

Subtasks

  • Subtask 1 (20%): 2≤n≤52\le n\le 5.

  • Subtask 2 (30%): 2≤n≤402\le n\le 40.

  • Subtask 3 (50%): 2≤n≤9992\le n\le 999.

Examples

Example 1

Input:

3

Output:

1 1 1
1 2 2
2 4 8
2 5 9
3 9 27
3 10 28

Explanation:

For every i, the first line uses the square and cube; the second increases those two values by 1. For this sample, the input is 3; the displayed rows follow these rules exactly.

Example 2

Input:

2

Output:

1 1 1
1 2 2
2 4 8
2 5 9

Explanation:

For every i, the first line uses the square and cube; the second increases those two values by 1. For this sample, the input is 2; the displayed rows follow these rules exactly.