by@nakario_jp
WA
2718ms
a=String.split(IO.read(:all),"\n") Enum.each(a,fn(x)->IO.puts Regex.replace(~r/K *T/,String.slice(x,0,:binary.match(hd(a),"T")|>elem(0))<>"T",&(String.duplicate("K",byte_size(&1))))end)
T K
T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T KKKKKKKKKK T