#include <stdio.h>

int main(void){
    int n, m,  i, j;
    int cards[][12] = {{}, {}, {}, {}};
    char c[4] = {'S', 'H', 'C', 'D'};

    scanf("%d", n);
    for(i = 0; i < n; i++){
        scanf("%c %d", &c, &m);
        switch(c){
            case 'S':
                 cards[0][m - 1] = 1;
                 break;
            case 'H':
                 cards[1][m - 1] = 1;
                 break;
            case 'C':
                 cards[2][m - 1] = 1;
                 break;
            case 'D':
                 cards[3][m - 1] = 1;
                 break;
        }
    }
    for(i = 0; i < 4; i++){
        for(j = 0; j < 12; j++){
            if(!cards[i][j])
                printf("%c %d\n", c[i], j + 1);
        }
    }
    return 0;
}
  