
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
Let \( r(n) \) be the number of \( n \times n \) matrices \( A = (a_{ij}) \) such that:
1. Each \( a_{ij} = -1, 0, or 1 \).
2. If we take any \( n \) elements \( a_{ij} \), no two in the same row or column, then their sum is the same.

Find rational numbers \( a, b, c, d, u, v, w \) such that \( r(n) = a u^n + b v^n + c w^n + d \).

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