Given two digit-strings $A$ and $B$, let $AB$ be their concatenation. So for example, if $A = ``102"$ and $B = ``101"$, $AB = ``102101"$.

We then say $AB \geq BA$ since $102101 \geq 101102$.

Now given digit strings $A$, $B$, and $C$, is it true that $$AB \geq BA \land BC \geq CB \Rightarrow AC \geq CA$$?

Context: This page gives 5 "simple" programming exercises. One of them is

Given a list of non negative integers, arranges them such that they form the largest possible number. For example, given [50, 2, 1, 9], the largest formed number is 95021.

My solution *(and his solution)* was to order the strings using the above comparison. This appears to work, but I'd like to prove it. I was able to come close to a proof, but it relies on the above comparison being a total preorder.

I've tried to prove the above transitivity relation in various ways, but have failed. A computer simulation of the first 100,000 numbers seems to imply it's true, though.