#include <stdio.h>

int main(void){

	
	int cards[4][13]={{0},{0}};/*2?¬??????????????????????*/
	int j,n,a;/*a?????????????????¨*/
	char i;	/*i????¨????*/

	scanf("%d",&n);
	printf("%d\n",n);

	for(i=0;i<n;i++){
	char b;
	int c;
	scanf("%c %d\n",&b, &c);
	if(b=='S'){		/*??\???????????????????????????????????????????´?*/
		cards[0][c]=1;
	}else if(b=='H'){
		cards[1][c]=1;
	}else if(b=='C'){
		cards[2][c]=1;
	}else if(b=='D'){
		cards[3][c]=1;
	}
	}
	char pattern[]={'S','H','C','D'}
	for(i=0;i<4;i++){
		for(j=1;j<=13;j++){
		if(cards[i][j]==0){ /*???????????????????????????????????????*/
		printf("%c %d\n",pattern[i],j); 
		}
	}
	}
	return 0;
}