#include<stdio.h>
int main(void){
	
	
	int s[12]={1,2,3,4,5,6,7,8,9,10,11,12,13};
	int h[12]={1,2,3,4,5,6,7,8,9,10,11,12,13};
	int c[12]={1,2,3,4,5,6,7,8,9,10,11,12,13};
	int d[12]={1,2,3,4,5,6,7,8,9,10,11,12,13};
	
	int n,a;
	char x;		//??????(S,H,C,D)
	int y;		//?????????(1-13)
	
	scanf("%d",&n);
	
	for(a=0;a<n;a++){
		scanf("%c %d",&x,&y);
		
		if(x==S){
			s[y-1]=0;
		}else if(x==H){
			h[y-1]=0;
		}else if(x==C){
			c[y-1]=0;
		}else if(x==D){
			d[y-1]=0;
		}
	}
	
	for(a=0;a<=12;a++){
		
		if(s[a]!=0){
			printf("S %d",s[a]);
		}
	}
	
	
	for(a=0;a<=12;a++){
		
		if(h[a]!=0){
			printf("H %d",h[a]);
		}
	}
	
	
	for(a=0;a<=12;a++){
		
		if(c[a]!=0){
			printf("C %d",c[a]);
		}
	}
	
	
	for(a=0;a<=12;a++){
		
		if(d[a]!=0){
			printf("D %d",d[a]);
		}
	}
	
	
	return 0;
}