
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 the maximum possible value of  $n$ , such that the integers  $1,2,\ldots n$  can be filled once each in distinct cells of a  $2015\times 2015$  grid and satisfies the following conditions:
[list]
[*] For all  $1\le i \le n-1$ , the cells with  $i$  and  $i+1$  share an edge. Cells with  $1$  and  $n$  also share an edge. In addition, no other pair of numbers share an edge.
[*] If two cells with  $i<j$  in them share a vertex, then  $\min\{j-i,n+i-j\}=2$ .

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