The solution mirrors the string using the row above the input. It reads and erases the rightmost symbol (blue states) and adds it at the end of the new string (red states).


World during program execution.
Symbol is read (left) and added (right).