  cards = readlines.map(&:split)
  cards.shift

  picture = ["S","H","C","D"]
  number = [*1..13]

  4.times do |timesloop|
    newarray = []
    temparray = cards.select{|sel| sel[0] == picture[(timesloop)]}
    temparray = temparray.map{|a,b| b.to_i}
    newarray = number - temparray
    if newarray.count > 0
      for put in newarray
        puts("#{picture[(timesloop)]} #{put}")
      end
    end
  end
