#B3700. Exponent Multiplication Table

    ID: 11359 Type: Default 1000ms 256MiB

Exponent Multiplication Table

Exponent Multiplication Table

The Exponent Multiplication Table is defined similarly to the classic multiplication table, but using exponentiation. In this table, for each row i (1-indexed), you print i expressions of the form i ^ j = result where result is computed as \(i^j\) (i.e. i multiplied by itself j times). For example, the third row is:

3 ^ 1 = 3 3 ^ 2 = 9 3 ^ 3 = 27

Your task is to output the first n rows of the exponent multiplication table. Each expression in a row should be separated by exactly one space.

inputFormat

The input consists of a single integer n (1 ≤ n ≤ 20) on a single line, representing the number of rows to output.

outputFormat

Output n lines. The i-th line (1-indexed) should contain i expressions of the format "i ^ j = result" for j = 1 to i. Each expression must be separated by exactly one space.

sample

1
1 ^ 1 = 1