by@pizzacat83a
AC
958ms
0v i<o*48+1v?='T' vo*25n1< v>i25*=? >:>:0= ?v1'K'v ^o*84- v?=i< v =*25i< >?v ^+ >~1v ^o*25n< n1-1;?=0:<
T K
1 1 1 1 1 1 1 111111111