num = gets.to_i words1 = gets.split words2 = gets.split differ = Array.new # element num == 1 if num == 1 puts 1, words1, words2 return end diff = words1 & words2 differ = words1 - diff index = words1.find_index(differ[0]) puts index + 1, words1[index], words2[index]