import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Main2 { public static void main(String[] args) { try (Scanner scan = new Scanner(System.in)) { int n = Integer.parseInt(scan.next()); ArrayList list = new ArrayList<>(); for(int i=0; i 0) System.out.print(" "); char f = list.get(i).charAt(0); if(f == '0') f = 'D'; else if(f == '1') f = 'C'; else if(f == '2') f = 'H'; else if(f == '3') f = 'S'; char l = list.get(i).charAt(1); if(l == '1') l = 'A'; else if(l == 'A') l = 'T'; else if(l == 'B') l = 'J'; else if(l == 'C') l = 'Q'; else if(l == 'D') l = 'K'; System.out.print("" + f + l); } } } }