int main(){
    int i,n,u,p,x,k[4][13],s[52];
    char t[52];
    scanf("%d",&n);
    for(i=1;i<=n;i+=1){
        scanf("%c%d",&t[i],&s[i]);
        x=s[i];
        if(t[i]=='S'){
            k[1][x]=1;
        }
        else if(t[i]=='H'){
            k[2][x]=1;
        }
        else if(t[i]=='C'){
            k[3][x]=1;
        }
        else{
            k[4][x]=1;
        }
    }
    for(u=1;u<=4;u+=1){
        for(p=1;p<=13;p+=1){
            if(k[u][p]!=1){
                printf("S %d\n",k[u][p]);
            }
        }
    }
    return 0;
}