package me.yukicoder; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class No0547 { public static void main(String[] args) { try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) { int length = Integer.parseInt(br.readLine()); int cnt; String[] str1 = br.readLine().split(" "); String[] str2 = br.readLine().split(" "); for (cnt = 0; cnt < length; cnt++) { if (str1[cnt].equals(str2[cnt])) { break; } } System.out.println((cnt + 1) + "\n" + str1[cnt] + "\n" + str2[cnt]); } catch (IOException e) { e.printStackTrace(); } } }