i'm in desperate need of your much appreciated expertise with trying to define the following order relation,

A A A
a A a A b A
a A b A a A
b A a A a A
...
A .. B .. A
..
A .. B .. B
...
B .. A .. A
...

guess it might be somewhat near a lexicographical order, not a straightforward alphabetical order tho, but more the way semitic dictionaries are ordered by roots..
thanks a lot !!