{-# LANGUAGE FlexibleContexts, OverloadedStrings #-} import Control.Applicative import Control.Monad import qualified Data.ByteString.Char8 as B import Data.Maybe (fromJust) import Text.Printf import Debug.Trace solve (s:ss) (t:ts) n = if s /= t then print n >> B.putStrLn s >> B.putStrLn t else solve ss ts (n+1) main = do [n] <- getInts s <- B.words <$> B.getLine t <- B.words <$> B.getLine solve s t 1 -- util getInts :: IO [Int] getInts = map (fst . fromJust . B.readInt) . B.words <$> B.getLine substr :: Int -> Int -> B.ByteString -> B.ByteString substr b l s = B.take l $ B.drop b s