
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
We call a finite string of the symbols X and O balanced if and only if every substring of consecutive symbols has a difference of at most 2 between the number of Xs and the number of Os. For example, XOOXOOX is not balanced because the substring OOXOO has a difference of 3. Find the number of balanced strings of length n.

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