L={'S':[],'H':[],'C':[],'D':[]}
for i in [input().split() for i in range(int(input()))]:
  L[i[0]].append(int(i[1]))
for i in ['S','H','C','D']:
  for j in range(1,14):
    if j not in L[i]:
      print(i,j)