
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
A table has $m$ rows and $n$ columns. A horizontal move is defined as a permutation of the elements of the table where each element remains in the same row as before the permutation. Similarly, a vertical move is defined as a permutation of the elements where each element remains in the same column. Determine the smallest number $k$ such that any permutation of the elements of the table can be achieved in $k$ moves (of any type), but there exists a permutation that cannot be achieved in fewer than $k$ moves.

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