#include <stdio.h>

int main()
{
  int a[4][13];
  int i, n, mark, number, S, H, C, D, j;
  
  for (m = 0; m <= 3; m++){
    for (j = 0; j <= 12; j++){
      a[m][j] = 0;
    }
  }
  scanf ("%d", &n);
  for ( i = 0; i <= n; i++)
    {
      scanf ("%c %d", &mark, &number);
      S = 0;
      H = 1;
      C = 2; 
      D = 3;
      a[mark][number] = 1;
    }
  for ( m = 0; m <= 3; m++){
    for (j = 0; j <= 12; j++){
      if (a[m][j] == 0){
	S = 0;
	H = 1;
	C = 2; 
	D = 3;
	printf ("%c %d\n",m, j);
      }
    }
  }
  
  return 0;
  
}