n = gets.strip.to_i s = gets.strip.split(' ') t = gets.strip.split(' ') (0...n).each do |i| if s[i] != t[i] puts i + 1 puts s[i] puts t[i] break end end