In[]:=
MultiwaySystem[{"AB""BA"},{"AAAAABBBB"},5,"CausalInvariantQ"]
Out[]=
True