
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Find all positive integers \( n \) such that when the numbers \( 1, 2, \cdots, n^2 \) are filled into an \( n \times n \) grid, each number occupying exactly one cell, the average of the \( n \) numbers in each row and each column (a total of \( 2n \) averages) is an integer.

Present the answer in LaTex format: \boxed{Your answer}
user