n = gets.to_i s = gets.split t = gets.split n.times do |i| if s[i] != t[i] puts i + 1, s[i], t[i] exit end end