Result

WA

Duration

2122ms

Code [DL]

import java.util.Scanner;
public class Main{
public static void main(String[]a){
boolean b=false;
int d=1;
Scanner s=new Scanner(System.in);
String g;
while((g=s.nextLine())!=null){
for(int i=0;i<g.length();++i){
char c=g.charAt(i);
if(c>83)d=0;
b=c==75||b&&d>0;
System.out.print(d==0||b?"A":c+"");
d=++d%50;
}System.out.println();}}}

stdin

                                              T   
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
           K                                      

stdout

stderr

/tmp/A.java:2: error: class Main is public, should be declared in a file named Main.java
public class Main{
       ^
1 error
Error: Could not find or load main class A
Caused by: java.lang.ClassNotFoundException: A
rm: can't remove '/tmp/A.class': No such file or directory

strace