import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Scanner;

/**
 * Created 2017/06/11.
 */
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    
    
    //?????¶????????¨??????????????????
    LinkedHashMap<String,LinkedHashSet<Integer>> dr = new LinkedHashMap<>();
    String s = "S";
    String h = "H";
    String c = "C";
    String d = "D";
    
    dr.put(s,rankmake());
    dr.put(h,rankmake());
    dr.put(c,rankmake());
    dr.put(d,rankmake());
    
    //System.out.println(dr); 
    //??\????????\?????¨????????????

    int n = sc.nextInt();
    for(int i = 0; i < n; i++) {
      String d_input = sc.next();
      int r_input = sc.nextInt();
      dr.get(d_input).remove(r_input);
    }
    //??¨?????????????????????
    //System.out.println(dr); //????????????
    
    //?????????????????¨??????hashset??????????¨??????????????????????for?????§??¨??¨??¨????????????????????§
    for(String key : dr.keySet()){
      LinkedHashSet<Integer> r_end =dr.get(key);
      for(int i : r_end){
        System.out.println(key + " " + i);
      }
    }

  }
  public static LinkedHashSet<Integer> rankmake() {
    LinkedHashSet<Integer> rank = new LinkedHashSet<>();
    for(int i = 1;i <=13;i++){
      rank.add(i);
    }
    return rank;
  }
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz