str, *num = gets.split str = str.split(//) count = 0 num.map(&:to_i).uniq.sort.reverse.each do |i| str.delete_at(i) end puts str.join