#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

typedef long long            ll;
typedef unsigned long long   ull;
typedef vector<int>          vi;
typedef vector<ll>           vl;
typedef pair<int, int>       pi;
typedef pair<ll, ll>         pl;
typedef vector<pi>           vpi;
typedef vector<pl>           vpl;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define read        freopen("in.c", "r", stdin)
#define write       freopen("out.c", "w", stdout)
#define all(a)      a.begin(), a.end()
#define bye         exit(0)
#define mp          make_pair
#define ff          first
#define ss          second
#define L(x)        ((x) << 1)
#define R(x)        ((x) << 1 | 1)
#define SZ(a)       (ll)(a).size()
#define pb          push_back
#define eb          emplace_back
#define eps         1e-9
#define inf         (1000000000)
#define infl        (1000000000000000000LL)
#define cs(p)       printf("Case %d:", (p)++)
#define ptc(c)      putchar(c)
#define gtc()       getchar()
#define nl          puts("")
#define sp          printf(" ")
#define out(a)      printf("%lld", (ll)(a))
#define SET(a, x)   memset((a), x, sizeof(a))
#define dbg(x)      cout << "--- " << #x << " = " << (x) << '\n'

ll bgm(ll a, ll b, ll m) {
    b = (b == -1) ? (m - 2) : b;
    a %= m;
    ll rem = 1;
    while(b != 0) {
        if(b&1)
            rem = (rem * a) % m;
        a = (a * a) % m;
        b >>= 1;
    }
    return rem;
}

inline ll in() {
    ll a;
    assert(scanf("%lld", &a) != EOF);
    return a;
}

const int MAX = 1000000 + 5;
const int LEN = 50;
const ll MOD = 1000000007;

int s[14],h[14],c[14],d[14];

void print(int *ara,char s){
	for(int i=1;i<14;i++){
		if(ara[i]==0) cout << s << " " << i << endl;
	}
}

void print1(int *ara,char s){
    int temp;
    for(int i=1;i<14;i++){
        if(ara[i]==0) {
            cout << s << " " << i;
            temp=i;
            break;
        }
    }
    for(int i=temp+1;i<14;i++){
        if(ara[i]==0){
            cout << endl << s << " " << i;
        }
    }
}

int main() {
    #ifndef ONLINE_JUDGE
    read, write;
    #endif
    int n,num;
    cin >> n;
    string str;
    while(n--){
    	cin >> str >> num;
    	if(str=="S") s[num]=1;
    	else if(str=="H") h[num]=1;
    	else if(str=="C") c[num]=1;
    	else d[num]=1;
    }
    print(s,'S');
    print(h,'H');
    print(c,'C');
    print1(d,'D');

    return 0;
}

