Java版
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String str = in.next();
char c = str.charAt(0);
for(char i = c; i >='A'; i--){
for(char j=c; j>='A'; j--){
if(j<=i) System.out.print(j);
else System.out.print(" ");
}
for(char j='A'; j<i; j++){
System.out.print(j);
}
System.out.println();
}
}
}