import Data.Char (digitToInt) import Data.List main = do n <- getLine case (remainder n 3, remainder n 5) of (0, 0) -> putStrLn "FizzBuzz" (0, _) -> putStrLn "Fizz" (_, 0) -> putStrLn "Buzz" (_, _) -> putStrLn n remainder :: String -> Int -> Int remainder n m = foldl' (\ans x -> (ans*4 + x) `mod` m) 0 $ map digitToInt n