
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
Let  $(a_1,a_2,\ldots, a_{13})$  be a permutation of  $(1, 2, \ldots, 13)$ . Ayvak takes this permutation and makes a series of *moves*, each of which consists of choosing an integer  $i$  from  $1$  to  $12$ , inclusive, and swapping the positions of  $a_i$  and  $a_{i+1}$ . Define the *weight* of a permutation to be the minimum number of moves Ayvak needs to turn it into  $(1, 2, \ldots, 13)$ .
  
  The arithmetic mean of the weights of all permutations  $(a_1, \ldots, a_{13})$  of  $(1, 2, \ldots, 13)$  for which  $a_5 = 9$  is  $\frac{m}{n}$ , for coprime positive integers  $m$  and  $n$ . Find  $100m+n$ .

*Proposed by Alex Gu*

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