#include <iostream>
#include <cstdio>
using namespace std;

int main()
{
  bool cards[4][14];
  int n;
  int r;
  char m;

  for(int i = 0; i < 4; i++)
      for(int j = 1; j < 14; j++)
          cards[i][j];

  cin >> n;
  for(int x = 0; x < n; x++)
  {
      cin >> m >> r;
      if(m = 'S') cards[0][r] == 1;
      if(m = 'H') cards[1][r] == 1;        
      if(m = 'C') cards[2][r] == 1;
      if(m = 'D') cards[3][r] == 1;
  }

  for(int i = 0; i < 4; i++)
  {
      for(int j = 1; j < 14; j++)
    { 
      if(cards[i][j]) continue;
      if(i == 0) m = 'S';
      if(i == 1) m = 'H';
      if(i == 2) m = 'C';
      if(i == 3) m = 'D';
      cout << m << " " << j << endl;   
    }  
  }
  return 0;  
}