n = gets.chomp.to_i a = ["Petr","square1001"] a.each_with_index do |v,i| if n > 1 n = 1 else puts a[i == 0 ? 1 : 0] break end end