import java.util.*; public class Main { static char[] mark ={'D','C','H','S'}; static char[] number ={'A','2','3','4','5','6','7','8','9','T','J','Q','K'}; static int to_int(String string){ int tmp=0; for(int i=0;i<4;i++){ if(string.charAt(0)==mark[i]) tmp+=i*13; } for(int i=0;i<13;i++){ if(string.charAt(1)==number[i])tmp+=i+1; } return tmp; } static String to_string(int a){ String ret = ""; ret+=mark[(a-1)/13]; ret+=number[a-((a-1)/13)*13-1]; return ret; } public static void main(String[] args){ // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] in = new int[N]; for(int i=0;i