puts$<.map{|l|(%w[m kg s A K mol cd].map{|u|c=0;[l.scan(u){c+="#{$'[0]} 1".hex},u][c]||u+"#{c}"}-[l])*' '}