import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); String []S = new String[N]; String []T = new String[N]; for(int i = 0; i < N; i++) { S[i] = scan.next(); } for(int i = 0; i < N; i++) { T[i] = scan.next(); } scan.close(); for(int i = 0; i < N; i++) { if(!S[i].equals(T[i])) { System.out.println(i + 1); System.out.println(S[i]); System.out.println(T[i]); break; } } } }