The task solution

Conditions

  1. Select words that start with a capital letter.
  2. Select words that on an even line.
  3. Each word at the end of a line is considered the last.

To start

  ruby main.rb