import Control.Applicative readInt = (readLn :: IO Int) main :: IO () main = do n <- readInt xs <- words <$> getLine ys <- words <$> getLine let (a, b, c) = solve (1, xs, ys) putStrLn $ show a putStrLn b putStrLn c solve :: (Integer, [String], [String]) -> (Integer, String, String) solve (i, (x:xs), (y:ys)) = if x /= y then (i, x, y) else solve (i + 1, xs, ys)