N = gets.to_i S,T = 2.times.map{ gets.chomp.split } puts N.times.find{|i| S[i] != T[i] }.then{|i| [i+1,S[i],T[i]]}