import java.util.*; class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int N = Integer.parseInt(in.nextLine()); String S = in.nextLine(); String T = in.nextLine(); String[] Sattr = S.split(" "); String[] Tattr = T.split(" "); for (int i = 0; i < N; i++) { if (!Sattr[i].equals(Tattr[i])) { System.out.println(i+1); System.out.println(Sattr[i]); System.out.println(Tattr[i]); break; } } } }