Question 4
Let $a_1,a_2,a_3,\ldots,a_9$ be a random arrangement of the numbers $1,2,3,\ldots,9$. What is the greatest possible value of
$$|a_1-\sqrt3a_2|+|a_2-\sqrt3a_3|+|a_3-\sqrt3a_4|+\cdots+|a_8-\sqrt3a_9|+|a_9-\sqrt3a_1|?$$
$$|a_1-\sqrt3a_2|+|a_2-\sqrt3a_3|+|a_3-\sqrt3a_4|+\cdots+|a_8-\sqrt3a_9|+|a_9-\sqrt3a_1|?$$