s=input() n=s.index("T") print(s) while 1: print(s) t=input() try: m=t.index("K") s=t[:m]+"K"*(n-m+1) except:pass