import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String[] aArr = new String[n]; for (int i = 0; i < n; i++) { aArr[i] = sc.next(); } String[] bArr = new String[n]; for (int i = 0; i < n; i++) { String s = sc.next(); if (!aArr[i].equals(s)) { System.out.println(i + 1); System.out.println(aArr[i]); System.out.println(s); return; } } } }