# -*- coding: utf-8 -*-

n = int(input())
s = []
h = []
c = []
d = []

for i in range(13):
    s.append(i + 1)
    h.append(i + 1)
    c.append(i + 1)
    d.append(i + 1)

for j in range(n):
    x = list(input().split())
    if x[0] is 'S':
        s.remove(int(x[1]))
    elif x[0] is 'H':
        h.remove(int(x[1]))
    elif x[0] is 'C':
        c.remove(int(x[1]))
    elif x[0] is 'D':
        d.remove(int(x[1]))

while len(s) != 0:
    for i in range(len(s)):
        print('{0} {1}'.format(s[0], s[1]))
    break

while len(h) != 0:
    for i in range(len(h)):
        print('{0} {1}'.format(h[0], h[1]))
    break

while len(c) != 0:
    for i in range(len(c)):
        print('{0} {1}'.format(c[0], c[1]))
    break

while len(d) != 0:
    for i in range(len(d)):
        print('{0} {1}'.format(d[0], d[1]))
    break
