Cards numbered 1 to 9 are arranged at random in a row. In a move, one may choose any block of consecutive cards whose numbers are in ascending or descending order, and switch the block around. For example, 9 1
may be changed to
. Prove that in at most 12 moves, one can arrange the 9 cards so that their numbers are in ascending or descending order.
![\underline{6\ 5\ 3}](/media/m/2/c/c/2cceff91017fdf0ff563d74b4ce7b663.png)
![2\ 7\ 4\ 8](/media/m/c/4/1/c4199a09d4d4ba193ac71e80ead9220b.png)
![9 1](/media/m/2/4/a/24a108f39ce2c084dcd0d94df286aa49.png)
![\underline{3\ 5\ 6}](/media/m/1/5/4/154bef767e33701042bf70fc042e2e60.png)
![2\ 7\ 4\ 8](/media/m/c/4/1/c4199a09d4d4ba193ac71e80ead9220b.png)