import sys
slist = [i for i in range(1, 14)]
hlist = [i for i in range(1, 14)]
clist = [i for i in range(1, 14)]
dlist = [i for i in range(1, 14)]
for line in sys.stdin:
    suit, rank = line.split()
    rankn = int(rank)
    if suit = 'S':
        if rankn in slist:
            slist.pop(rankn - 1)
    elif suit = 'H':
        if rankn in hlist:
            hlist.pop(rankn - 1)
    elif suit = 'C':
        if rankn in clist:
            clist.pop(rankn - 1)
    else:
        if rankn in dlist:
            dlist.pop(rankn - 1)
