#include <stdio.h>

int main (void)
{
	int i,j,k,n,b;
	char S[13],H[13],C[13],D[13],a;
	
	scanf("%d",&n);
	
	for( i=0 ; i<n ; i++){
		scanf("%c%d",&a,&b);
		else if(a=='S'){S[b-1]=b;}
		else if(a=='H'){H[b-1]=b;}
		else if(a=='C'){C[b-1]=b;}
		else if(a=='D'){D[b-1]=b;}
	}
	
	for( j=0 ; j<4 ; j++ ){
		for( k=0 ; k<13 ; k++ ){
			if(j==0){
				if(S[k]!=k+1){
					printf("S %d\n",k+1);
				}}if(j==1){
				if(H[k]!=k+1){
					printf("H %d\n",k+1);
				}}if(j==2){
				if(C[k]!=k+1){
					printf("C %d\n",k+1);
				}}if(j==3){
				if(D[k]!=k+1){
					printf("D %d\n",k+1);
				}}
			}
		}
		
		return 0;
}