import Control.Monad (replicateM) main = do getLine st <- zipst . map words <$> replicateM 2 getLine mapM putStrLn $ solve st zipst st = zip (head st) (last st) solve st = f 0 where f i | s /= t = [show (i + 1), s, t] | otherwise = f (i + 1) where (s, t) = st !! i