package main import ( "fmt" "strings" ) func main() { var n int fmt.Scan(&n) m := make(map[string]bool) for i := 0; i < n; i++ { var s string fmt.Scan(&s) m[s] = true } ans := make([]string, 0) for _, v1 := range "DCHS" { for _, v2 := range "A23456789TJQK" { s := string(v1) + string(v2) if m[s] { ans = append(ans, s) } } } fmt.Println(strings.Join(ans, " ")) }