b = gets.strip.split(' ').map(&:to_i) a = (1..10).to_a b.each do |bi| a.delete(bi) end p a[0]