gets p scan(/.* /).uniq.map{|s|i=1 scan(/^#{s}./){i*=$'.hex} puts$&+'%x'%i}