
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
Given a finite binary string  $S$  of symbols  $X,O$  we define  $\Delta(S)=n(X)-n(O)$  where  $n(X),n(O)$  respectively denote number of  $X$ 's and  $O$ 's in a string. For example  $\Delta(XOOXOOX)=3-4=-1$ . We call a string  $S$   $\emph{balanced}$  if every substring  $T$  of  $S$  has  $-2\le \Delta(T)\le 2$ . Find number of balanced strings of length  $n$ .

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