I’ve come across an interesting related problem. Initially, a chalkboard has the single letter words “A” and “B” written on it. The allowed moves are to concatenate one of the strings on the board to the other, on either the left or right. In other words, if at any point the two words on the board are (x,y), then the allowed moves are to (xy,y), (yx,y), (x,xy), and (x,yx). The goal is to prove that at any point, both words on the board are papaya words. I thought you might find it interesting, though I do not know the solution.
A, B

AB, B

ABB, B

ABB, BABB

ABB, BABBABB

BABBABBABB, BABBABB

]]>