set s [read stdin] while {$s!=[set s [regsub "(.) ?(T.*)_" $s \\2\\1]]} {} puts $s