
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
For positive integers  $m,n \geq 2$ , let  $S_{m,n} = \{(i,j): i \in \{1,2,\ldots,m\}, j\in \{1,2,\ldots,n\}\}$  be a grid of  $mn$  lattice points on the coordinate plane. Determine all pairs  $(m,n)$  for which there exists a simple polygon  $P$  with vertices in  $S_{m,n}$  such that all points in  $S_{m,n}$  are on the boundary of  $P$ , all interior angles of  $P$  are either  $90^{\circ}$  or  $270^{\circ}$  and all side lengths of  $P$  are  $1$  or  $3$ .

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