#include <iostream>

using namespace std;

int main() {
 bool spade[13] = { false }, heart[13] = { false }, club[13] = { false }, diamond[13] = { false };
 int having, n;
 char mark;

 cin >> having;

 for(int i = 0;i < having;i++) {
  cin >> mark >> n;

  switch(mark) {
   case 'S':
    spade[n - 1] = true;
    break;
   case 'H':
    heart[n - 1] = true;
    break;
   case 'C':
    club[n - 1] = true;
    break;
   case 'D':
    diamond[n - 1] = true;
    break;
  }

  for(int i = 0;i < 13;i++) {
   if(!spade[i])
    cout << "S " << i - 1 << endl;
  }

  for(int i = 0;i < 13;i++) {
   if(!heart[i])
    cout << "H " << i - 1 << endl;
  }

  for(int i = 0;i < 13;i++) {
   if(!club[i])
    cout << "C " << i - 1 << endl;
  }

  for(int i = 0;i < 13;i++) {
   if(!diamond[i])
    cout << "D " << i - 1 << endl;
  }

  return 0;
}