#include<iostream>

using namespace std;

int main()
{
int n;
cin >> n;

int cards[4][52] = {0};
char p[4] = {'S','H','C','D'};

for (int i = 0; i < n ; i++)
{
char c[52];
int x[52];
cin >> c[i] >> x[i];
}

for (int i = 0; i < n; i++)
{
if (c[i] == 'S')
cards[0][x[i]] = x[i];
else if (c[i] == 'H')
cards[1][x[i]] = x[i];
else if (c[i] == 'C')
cards[2][x[i]] = x[i];
else
cards[3][x[i]] = x[i];
}

for (int i = 0; i < 4; i++)
{for (int j = 0; j < 52; j++)
{
if (cards[i][j] == 0)
   cout << p[i] << ' ' << j << '\n';
}
}