include<stdio.h>
main()
{
    int i, j, n, count[4][13];
    int l;
    scanf("%d", &n);
    for(i = 0; i < n; i++){
        scanf("%c ", &l);
        switch(l){
        case 'S':
            scanf("%d", &l);
            count[0][l - 1] = 1;
            break;
        case 'H':
            scanf("%d", &l);
            count[1][l - 1] = 1;
            break;
        case 'C':
            scanf("%d", &l);
            count[2][l - 1] = 1;
            break;
        case 'D':
            scanf("%d", &l);
            count[3][l - 1] = 1;
            break;
        }
    }
    for(j = 0; j < 4; j++){
        switch(j){
        case 0:
            l = 'S';
            break;
        case 1:
            l = 'H';
            break;
        case 2:
            l = 'C';
            break;
        case 3:
            l = 'D';
            break;
        }
        for(i = 0; i < 13; i++){
            if(!count[j][i]){
                printf("%c %d\n", l, i + 1);
            }
????????????}
    }
}