
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
In the cells of a $100 \times 100$ square, the numbers $1, 2, \ldots, 10000$ were placed, each exactly once, such that numbers differing by 1 are recorded in adjacent cells along the side. After that, the distances between the centers of each two cells, where the numbers in those cells differ exactly by 5000, were calculated. Let $S$ be the minimum of these distances. What is the maximum value that $S$ can take?

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