cardlist = [[i for i in range(1,14)] for j in range(4)]

n=int(eval(input()))

for s in range(0,n):

  x,y=(input().split())

  y=int(y)

  if   x =="S":

    cardlist[0].remove(y)

  elif x =="H":

    cardlist[1].remove(y)

  elif x =="C":

    cardlist[2].remove(y)

  else:

    cardlist[3].remove(y)

for i in cardlist[0]:

  print(("S",i))

for i in cardlist[1]:

  print(("H",i))

for i in cardlist[2]:

  print(("C",i))

for i in cardlist[3]:

  print(("D",i))

  
N = int(eval(input()))

x = [f"{x} {i}" for x in 'SHCD' for i in range(1,14) ]

[x.remove(eval(input())) for i in range(N)]

for i in x:

    print(i)

cardlist = [[i for i in range(1, 14)] for j in range(4)]
n = int(eval(input()))
for s in range(0, n):
    x, y = input().split()
    y = int(y)
    if x == "S":
        cardlist[0].remove(y)
    elif x == "H":
        cardlist[1].remove(y)
    elif x == "C":
        cardlist[2].remove(y)
    else:
        cardlist[3].remove(y)
for i in cardlist[0]:
    print(("S", i))
for i in cardlist[1]:
    print(("H", i))
for i in cardlist[2]:
    print(("C", i))
for i in cardlist[3]:
    print(("D", i))

N = int(eval(input()))
x = [f"{x} {i}" for x in "SHCD" for i in range(1, 14)]
[x.remove(eval(input())) for i in range(N)]
for i in x:
    print(i)

-cardlist = [[i for i in range(1, 14)] for j in range(4)] -n = int(eval(input())) -for s in range(0, n): -    x, y = input().split() -    y = int(y) -    if x == "S": -        cardlist[0].remove(y) -    elif x == "H": -        cardlist[1].remove(y) -    elif x == "C": -        cardlist[2].remove(y) -    else: -        cardlist[3].remove(y) -for i in cardlist[0]: -    print(("S", i)) -for i in cardlist[1]: -    print(("H", i)) -for i in cardlist[2]: -    print(("C", i)) -for i in cardlist[3]: -    print(("D", i)) +N = int(eval(input())) +x = [f"{x} {i}" for x in "SHCD" for i in range(1, 14)] +[x.remove(eval(input())) for i in range(N)] +for i in x: +    print(i)