#include <stdio.h>
#define FINDING       1
#define MISSING       0
#define SUIT_NUM      4
#define RANK_NUM      13
#define SUIT_SPADES   'S'
#define SUIT_HEARTS   'H'
#define SUIT_CLUBS    'C'
#define SUIT_DIAMONDS 'D'

int suitToNum(char suit)
char numToSuit(int num)

int main(void) {

    int i;
    int finding_num;
    char suit;
    int rank;
    bool cards[4][13] = { MISSING };
    
    scanf("%d", &finding_num);
    
    

    for(i = 0; i < finding_num; i++) {
        scanf("%c %d", &suit, &rank);
        
        cards[suitToNum(suit)][rank] = FINDING;
    }
    
    for(i = 0; i < SUIT_NUM; i++) {
        for(j = 0; j < RANK_NUM; j++) {
            if(cards[i][j] == MISSING) {
                printf("%c %d\n", numToSuit(i), j);
            }
        }
    }
}

int suitToNum(char suit) {

    switch(suit) {
        case SUIT_SPADES :
            return 0;
        case SUIT_HEARTS :
            return 1;
        case SUIT_CLUBS :
            return 2;
        case SUIT_DIAMONDS :
            return 3;
    }
}

char numToSuit(int num) {
    
    switch(num) {
        case 0:
            return SUIT_SPADES;
        case 1:
            return SUIT_HEARTS;
        case 2:
            return SUIT_CLUBS;
        case 3:
            return SUIT_DIAMONDS;
    }
}