#include<iostream>
using namespace std;
int main(){
	int a,c[52],d=1;
	char b[52];
	cin>>a;
	for(int i=0;i<a;i++){
		cin>>b[i]>>c[i];
	}
	for(int i=0;i<13;i++){
		for(int j=0;j<a;j++){
			if(b[j]=='S' && c[j]==i+1){
				goto s;
			}
		}
		cout<<"S"<<" "<<i+1<<endl;
		s:
	}
	for(int i=0;i<13;i++){
		for(int j=0;j<a;j++){
			if(b[j]=='H' && c[j]==i+1){
				goto h;
			}
		}
		cout<<"H"<<" "<<i+1<<endl;
		h:
	}
	for(int i=0;i<13;i++){
		for(int j=0;j<a;j++){
			if(b[j]=='C' && c[j]==i+1){
				goto c;
			}
		}
		cout<<"C"<<" "<<i+1<<endl;
		c:
	}
	for(int i=0;i<13;i++){
		for(int j=0;j<a;j++){
			if(b[j]=='D' && c[j]==i+1){
				goto d;
			}
		}
		cout<<"D"<<" "<<i+1<<endl;
		d:
	}
}