#!/usr/bin/env python

if __name__ == '__main__':
    trump = [ '%c %d' % (c, r) for c in 'SHCD' for r in range(1,14) ]

    n = int(raw_input())
    for _ in range(n):
        trump.remove(raw_input())

    for t in trump:
        print t

