#include <stdio.h>

void array_reset( int*, int );
int main(){
    int n;
    char mark;
    int rank;
    int spade[13], hert[13], crab[13], dia[13];
    int i;
    
    array_reset( spade, 13 );
    array_reset( hert, 13 );
    array_reset( crab, 13 );
    array_reset( dia, 13 );

    scanf( "%d", &n );
    
    for( i = 0; i < n; i++ ){
        scanf( "%c %d", &mark, &rank );
        switch( mark ){
        case 'S':
            spade[ rank - 1 ] = 1;
            break;
        case 'H':
            hert[ rank - 1 ] = 1;
            break;
        case 'C':
            crab[ rank - 1 ] = 1;
            break;
        case 'D':
            dia[ rank - 1 ] = 1;
            break;
        default:;
        }
    }
    
    for( i = 0;i < 13;i++ ){
        if( spade[i] == 0 ){
            printf( "S %d\n", i + 1 );
        }
    }
    for( i = 0;i < 13;i++ ){
        if( hert[i] == 0 ){
            printf( "H %d\n", i + 1 );
        }
    }
    for( i = 0;i < 13;i++ ){
        if( crab[i] == 0 ){
            printf( "C %d\n", i + 1 );
        }
    }
    for( i = 0;i < 13;i++ ){
        if( dia[i] == 0 ){
            printf( "D %d\n", i + 1 );
        }
    }
    return 0;
}
