
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
 $N$  students are seated at desks in an  $m \times  n$  array, where  $m, n \ge  3$ . Each student shakes hands with the students who are adjacent horizontally, vertically or diagonally. If there are  $1020 $ handshakes, what is  $N$ ?

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