a = gets.split.map(&:to_i) b = (1..10).to_a 10.times do |e| unless a[e] == b[e] puts b[e] break end end