num = gets.to_i words1 = gets.split words2 = gets.split differ = Array.new index = 0 # element num == 1 if num == 1 puts 1, words1, words2 return end num.times do |i| if words1[i] != words2[i] index = i + 1 break end end puts index, words1[index-1], words2[index-1]