n = gets.to_i a = gets.split b = gets.split n.times do |i| if a[i] != b[i] puts i+1 puts a[i] puts b[i] break end end