import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        List<Integer> clover = new ArrayList<Integer>();
        List<Integer> spade = new ArrayList<Integer>();
        List<Integer> hart = new ArrayList<Integer>();
        List<Integer> dia = new ArrayList<Integer>();
        String cou = br.readLine();
        int count = Integer.parseInt(cou);
        int i=0;
        while(i<count) {
            String line = br.readLine();
            String[] line2 = line.split(" ");
            if(line2[0].equals("S")) {
                spade.add(new Integer(line2[1]));
            }else if(line2[0].equals("H")) {
                hart.add(new Integer(line2[1]));
            }else if(line2[0].equals("C")) {
                clover.add(new Integer(line2[1]));
            }else if(line2[0].equals("D")) {
                dia.add(new Integer(line2[1]));
            }
            i++;
        }
        List<Integer> clover_e = check(clover);
        List<Integer> spade_e = check(spade);
        List<Integer> hart_e = check(hart);
        List<Integer> dia_e = check(dia);
        print("S",spade_e);
        print("H",hart_e);
        print("C",clover_e);
        print("D",dia_e);
        
    }
    static void print(String mark,List<Integer> list) {
        for(int i=0;i<list.size();i++) {
            System.out.print(mark + " " + list.get(i));
            System.out.println();
        }
    }
    //絵柄がスペード、ハート、クラブ、ダイヤの順番で優先的に出力する。
    static List<Integer> check(List<Integer> list) {
        List<Integer> lack = new ArrayList<Integer>();
        int[] expect = {1,2,3,4,5,6,7,8,9,10,11,12,13};
        for(int i=0;i<expect.length;i++) {
            lack.add(new Integer(expect[i]));
        }
        lack.removeAll(list);
        return lack;
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        List<Integer> clover = new ArrayList<Integer>();
        List<Integer> spade = new ArrayList<Integer>();
        List<Integer> hart = new ArrayList<Integer>();
        List<Integer> dia = new ArrayList<Integer>();
        String cou = br.readLine();
        int count = Integer.parseInt(cou);
        int i=0;
        while(i<count) {
            String line = br.readLine();
            String[] line2 = line.split(" ");
            if(line2[0].equals("S")) {
                spade.add(new Integer(line2[1]));
            }else if(line2[0].equals("H")) {
                hart.add(new Integer(line2[1]));
            }else if(line2[0].equals("C")) {
                clover.add(new Integer(line2[1]));
            }else if(line2[0].equals("D")) {
                dia.add(new Integer(line2[1]));
            }
            i++;
        }
        List<Integer> clover_e = check(clover);
        List<Integer> spade_e = check(spade);
        List<Integer> hart_e = check(hart);
        List<Integer> dia_e = check(dia);
        print("S",spade_e);
        print("H",hart_e);
        print("C",clover_e);
        print("D",dia_e);
        
    }
    static void print(String mark,List<Integer> list) {
        for(int i=0;i<list.size();i++) {
            System.out.print(mark + " " + list.get(i));
            System.out.println();
        }
    }
    //絵柄がスペード、ハート、クラブ、ダイヤの順番で優先的に出力する。
    static List<Integer> check(List<Integer> list) {
        List<Integer> lack = new ArrayList<Integer>();
        int[] expect = {1,2,3,4,5,6,7,8,9,10,11,12,13};
        for(int i=0;i<expect.length;i++) {
            lack.add(new Integer(expect[i]));
        }
        lack.removeAll(list);
        return lack;
    }
} Main public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        List<Integer> clover = new ArrayList<Integer>();
        List<Integer> spade = new ArrayList<Integer>();
        List<Integer> hart = new ArrayList<Integer>();
        List<Integer> dia = new ArrayList<Integer>();
        String cou = br.readLine();
        int count = Integer.parseInt(cou);
        int i=0;
        while(i<count) {
            String line = br.readLine();
            String[] line2 = line.split(" ");
            if(line2[0].equals("S")) {
                spade.add(new Integer(line2[1]));
            }else if(line2[0].equals("H")) {
                hart.add(new Integer(line2[1]));
            }else if(line2[0].equals("C")) {
                clover.add(new Integer(line2[1]));
            }else if(line2[0].equals("D")) {
                dia.add(new Integer(line2[1]));
            }
            i++;
        }
        List<Integer> clover_e = check(clover);
        List<Integer> spade_e = check(spade);
        List<Integer> hart_e = check(hart);
        List<Integer> dia_e = check(dia);
        print("S",spade_e);
        print("H",hart_e);
        print("C",clover_e);
        print("D",dia_e);
        
    } main {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        List<Integer> clover = new ArrayList<Integer>();
        List<Integer> spade = new ArrayList<Integer>();
        List<Integer> hart = new ArrayList<Integer>();
        List<Integer> dia = new ArrayList<Integer>();
        String cou = br.readLine();
        int count = Integer.parseInt(cou);
        int i=0;
        while(i<count) {
            String line = br.readLine();
            String[] line2 = line.split(" ");
            if(line2[0].equals("S")) {
                spade.add(new Integer(line2[1]));
            }else if(line2[0].equals("H")) {
                hart.add(new Integer(line2[1]));
            }else if(line2[0].equals("C")) {
                clover.add(new Integer(line2[1]));
            }else if(line2[0].equals("D")) {
                dia.add(new Integer(line2[1]));
            }
            i++;
        }
        List<Integer> clover_e = check(clover);
        List<Integer> spade_e = check(spade);
        List<Integer> hart_e = check(hart);
        List<Integer> dia_e = check(dia);
        print("S",spade_e);
        print("H",hart_e);
        print("C",clover_e);
        print("D",dia_e);
        
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) List<Integer> clover = new ArrayList<Integer>(); clover new ArrayList<Integer>() List<Integer> spade = new ArrayList<Integer>(); spade new ArrayList<Integer>() List<Integer> hart = new ArrayList<Integer>(); hart new ArrayList<Integer>() List<Integer> dia = new ArrayList<Integer>(); dia new ArrayList<Integer>() String cou = br.readLine(); cou br.readLine() br.readLine br int count = Integer.parseInt(cou); count Integer.parseInt(cou) Integer.parseInt Integer cou int i=0; i 0 while(i<count) {
            String line = br.readLine();
            String[] line2 = line.split(" ");
            if(line2[0].equals("S")) {
                spade.add(new Integer(line2[1]));
            }else if(line2[0].equals("H")) {
                hart.add(new Integer(line2[1]));
            }else if(line2[0].equals("C")) {
                clover.add(new Integer(line2[1]));
            }else if(line2[0].equals("D")) {
                dia.add(new Integer(line2[1]));
            }
            i++;
        } i<count i count {
            String line = br.readLine();
            String[] line2 = line.split(" ");
            if(line2[0].equals("S")) {
                spade.add(new Integer(line2[1]));
            }else if(line2[0].equals("H")) {
                hart.add(new Integer(line2[1]));
            }else if(line2[0].equals("C")) {
                clover.add(new Integer(line2[1]));
            }else if(line2[0].equals("D")) {
                dia.add(new Integer(line2[1]));
            }
            i++;
        } String line = br.readLine(); line br.readLine() br.readLine br String[] line2 = line.split(" "); line2 line.split(" ") line.split line " " if(line2[0].equals("S")) {
                spade.add(new Integer(line2[1]));
            }else if(line2[0].equals("H")) {
                hart.add(new Integer(line2[1]));
            }else if(line2[0].equals("C")) {
                clover.add(new Integer(line2[1]));
            }else if(line2[0].equals("D")) {
                dia.add(new Integer(line2[1]));
            } line2[0].equals("S") line2[0].equals line2[0] line2 0 "S" {
                spade.add(new Integer(line2[1]));
            } spade.add(new Integer(line2[1])) spade.add spade new Integer(line2[1]) if(line2[0].equals("H")) {
                hart.add(new Integer(line2[1]));
            }else if(line2[0].equals("C")) {
                clover.add(new Integer(line2[1]));
            }else if(line2[0].equals("D")) {
                dia.add(new Integer(line2[1]));
            } line2[0].equals("H") line2[0].equals line2[0] line2 0 "H" {
                hart.add(new Integer(line2[1]));
            } hart.add(new Integer(line2[1])) hart.add hart new Integer(line2[1]) if(line2[0].equals("C")) {
                clover.add(new Integer(line2[1]));
            }else if(line2[0].equals("D")) {
                dia.add(new Integer(line2[1]));
            } line2[0].equals("C") line2[0].equals line2[0] line2 0 "C" {
                clover.add(new Integer(line2[1]));
            } clover.add(new Integer(line2[1])) clover.add clover new Integer(line2[1]) if(line2[0].equals("D")) {
                dia.add(new Integer(line2[1]));
            } line2[0].equals("D") line2[0].equals line2[0] line2 0 "D" {
                dia.add(new Integer(line2[1]));
            } dia.add(new Integer(line2[1])) dia.add dia new Integer(line2[1]) i++ i List<Integer> clover_e = check(clover); clover_e check(clover) check clover List<Integer> spade_e = check(spade); spade_e check(spade) check spade List<Integer> hart_e = check(hart); hart_e check(hart) check hart List<Integer> dia_e = check(dia); dia_e check(dia) check dia print("S",spade_e) print "S" spade_e print("H",hart_e) print "H" hart_e print("C",clover_e) print "C" clover_e print("D",dia_e) print "D" dia_e String[] args args static void print(String mark,List<Integer> list) {
        for(int i=0;i<list.size();i++) {
            System.out.print(mark + " " + list.get(i));
            System.out.println();
        }
    } print {
        for(int i=0;i<list.size();i++) {
            System.out.print(mark + " " + list.get(i));
            System.out.println();
        }
    } for(int i=0;i<list.size();i++) {
            System.out.print(mark + " " + list.get(i));
            System.out.println();
        } int i=0; int i=0; i 0 i<list.size() i list.size() list.size list i++ i++ i {
            System.out.print(mark + " " + list.get(i));
            System.out.println();
        } {
            System.out.print(mark + " " + list.get(i));
            System.out.println();
        } System.out.print(mark + " " + list.get(i)) System.out.print System.out System System.out mark + " " + list.get(i) mark + " " + list.get(i) mark " " list.get(i) list.get list i System.out.println() System.out.println System.out System System.out String mark mark List<Integer> list list //絵柄がスペード、ハート、クラブ、ダイヤの順番で優先的に出力する。
    static List<Integer> check(List<Integer> list) {
        List<Integer> lack = new ArrayList<Integer>();
        int[] expect = {1,2,3,4,5,6,7,8,9,10,11,12,13};
        for(int i=0;i<expect.length;i++) {
            lack.add(new Integer(expect[i]));
        }
        lack.removeAll(list);
        return lack;
    } check {
        List<Integer> lack = new ArrayList<Integer>();
        int[] expect = {1,2,3,4,5,6,7,8,9,10,11,12,13};
        for(int i=0;i<expect.length;i++) {
            lack.add(new Integer(expect[i]));
        }
        lack.removeAll(list);
        return lack;
    } List<Integer> lack = new ArrayList<Integer>(); lack new ArrayList<Integer>() int[] expect = {1,2,3,4,5,6,7,8,9,10,11,12,13}; expect {1,2,3,4,5,6,7,8,9,10,11,12,13} 1 2 3 4 5 6 7 8 9 10 11 12 13 for(int i=0;i<expect.length;i++) {
            lack.add(new Integer(expect[i]));
        } int i=0; int i=0; i 0 i<expect.length i expect.length expect expect.length i++ i++ i {
            lack.add(new Integer(expect[i]));
        } {
            lack.add(new Integer(expect[i]));
        } lack.add(new Integer(expect[i])) lack.add lack new Integer(expect[i]) lack.removeAll(list) lack.removeAll lack list return lack; lack List<Integer> list list public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        List<Integer> clover = new ArrayList<Integer>();
        List<Integer> spade = new ArrayList<Integer>();
        List<Integer> hart = new ArrayList<Integer>();
        List<Integer> dia = new ArrayList<Integer>();
        String cou = br.readLine();
        int count = Integer.parseInt(cou);
        int i=0;
        while(i<count) {
            String line = br.readLine();
            String[] line2 = line.split(" ");
            if(line2[0].equals("S")) {
                spade.add(new Integer(line2[1]));
            }else if(line2[0].equals("H")) {
                hart.add(new Integer(line2[1]));
            }else if(line2[0].equals("C")) {
                clover.add(new Integer(line2[1]));
            }else if(line2[0].equals("D")) {
                dia.add(new Integer(line2[1]));
            }
            i++;
        }
        List<Integer> clover_e = check(clover);
        List<Integer> spade_e = check(spade);
        List<Integer> hart_e = check(hart);
        List<Integer> dia_e = check(dia);
        print("S",spade_e);
        print("H",hart_e);
        print("C",clover_e);
        print("D",dia_e);
        
    }
    static void print(String mark,List<Integer> list) {
        for(int i=0;i<list.size();i++) {
            System.out.print(mark + " " + list.get(i));
            System.out.println();
        }
    }
    //絵柄がスペード、ハート、クラブ、ダイヤの順番で優先的に出力する。
    static List<Integer> check(List<Integer> list) {
        List<Integer> lack = new ArrayList<Integer>();
        int[] expect = {1,2,3,4,5,6,7,8,9,10,11,12,13};
        for(int i=0;i<expect.length;i++) {
            lack.add(new Integer(expect[i]));
        }
        lack.removeAll(list);
        return lack;
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        List<Integer> clover = new ArrayList<Integer>();
        List<Integer> spade = new ArrayList<Integer>();
        List<Integer> hart = new ArrayList<Integer>();
        List<Integer> dia = new ArrayList<Integer>();
        String cou = br.readLine();
        int count = Integer.parseInt(cou);
        int i=0;
        while(i<count) {
            String line = br.readLine();
            String[] line2 = line.split(" ");
            if(line2[0].equals("S")) {
                spade.add(new Integer(line2[1]));
            }else if(line2[0].equals("H")) {
                hart.add(new Integer(line2[1]));
            }else if(line2[0].equals("C")) {
                clover.add(new Integer(line2[1]));
            }else if(line2[0].equals("D")) {
                dia.add(new Integer(line2[1]));
            }
            i++;
        }
        List<Integer> clover_e = check(clover);
        List<Integer> spade_e = check(spade);
        List<Integer> hart_e = check(hart);
        List<Integer> dia_e = check(dia);
        print("S",spade_e);
        print("H",hart_e);
        print("C",clover_e);
        print("D",dia_e);
        
    }
    static void print(String mark,List<Integer> list) {
        for(int i=0;i<list.size();i++) {
            System.out.print(mark + " " + list.get(i));
            System.out.println();
        }
    }
    //絵柄がスペード、ハート、クラブ、ダイヤの順番で優先的に出力する。
    static List<Integer> check(List<Integer> list) {
        List<Integer> lack = new ArrayList<Integer>();
        int[] expect = {1,2,3,4,5,6,7,8,9,10,11,12,13};
        for(int i=0;i<expect.length;i++) {
            lack.add(new Integer(expect[i]));
        }
        lack.removeAll(list);
        return lack;
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        List<Integer> clover = new ArrayList<Integer>();
        List<Integer> spade = new ArrayList<Integer>();
        List<Integer> hart = new ArrayList<Integer>();
        List<Integer> dia = new ArrayList<Integer>();
        String cou = br.readLine();
        int count = Integer.parseInt(cou);
        int i=0;
        while(i<count) {
            String line = br.readLine();
            String[] line2 = line.split(" ");
            if(line2[0].equals("S")) {
                spade.add(new Integer(line2[1]));
            }else if(line2[0].equals("H")) {
                hart.add(new Integer(line2[1]));
            }else if(line2[0].equals("C")) {
                clover.add(new Integer(line2[1]));
            }else if(line2[0].equals("D")) {
                dia.add(new Integer(line2[1]));
            }
            i++;
        }
        List<Integer> clover_e = check(clover);
        List<Integer> spade_e = check(spade);
        List<Integer> hart_e = check(hart);
        List<Integer> dia_e = check(dia);
        print("S",spade_e);
        print("H",hart_e);
        print("C",clover_e);
        print("D",dia_e);
        
    }
    static void print(String mark,List<Integer> list) {
        for(int i=0;i<list.size();i++) {
            System.out.print(mark + " " + list.get(i));
            System.out.println();
        }
    }
    //絵柄がスペード、ハート、クラブ、ダイヤの順番で優先的に出力する。
    static List<Integer> check(List<Integer> list) {
        List<Integer> lack = new ArrayList<Integer>();
        int[] expect = {1,2,3,4,5,6,7,8,9,10,11,12,13};
        for(int i=0;i<expect.length;i++) {
            lack.add(new Integer(expect[i]));
        }
        lack.removeAll(list);
        return lack;
    }
}