#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

const int CN = 4;
const int RN = 13;
const char scs[] = {'S','H','C','D'};

bool cs[CN][RN]
int main(){
	int n;
	cin >> n;
	
	for(int i = 0; i < n; i++){
		char sc;
		int c,r;
		cin >> sc >> r;
		
		switch(sc){
			case 'S': c = 0; break;
			case 'H': c = 1; break;
			case 'C': c = 2; break;
			case 'D': c = 3; break;
		}
		
		cs[c][r-1] = true;
	}
	
	for(int c = 0; c < CN; c++)
		for(int r = 0; r < RN; r++)
			if(! cs[c][r]) printf("%c %d\n", scs[c], r + 1);
		return 0;
}
	