• + 0 comments
    import Data.List(intercalate)
    
    rotatedStrings :: String -> String
    rotatedStrings a = intercalate " " $ stringRotations a
    
    stringRotations :: String -> [String]
    stringRotations s = [rotate i s | i <- [1.. length s] ] where
        rotate i s = drop i s ++ take i s
    
    main :: IO ()
    main = do 
        _ <- getLine
        interact (unlines . map rotatedStrings . lines)