#!/usr/bin/python

n = int(input())
card = [[0 for i in range(13)] for i in range(4)]
print(len(card[0]))
for i in range(n):
  a,b = (i for i in input().split())
  b = int(b)-1

  if a == 'S':
    card[0][b] = 1
  elif a == 'H':
    card[1][b] = 1
  elif a == 'C':
    card[2][b] = 1
  elif a == 'D':
    card[3][b] = 1

for i in range(4):
  for j in range(13):
    if card[i][j] == 0:
      if i == 0:
        print('S ', end = '')
      elif i == 1:
        print('H ', end = '')
      elif i == 2:
        print('C ', end = '')
      elif i == 3:
        print('D ', end = '')
      print(str(j + 1))