import Control.Applicative ((<$>)) import Data.Bool (bool) import Data.List (unfoldr, foldl') import Data.Vector (Vector, (!), (//)) import qualified Data.Vector as V main :: IO () main = solve <$> readLn >>= putStrLn solve :: Int -> String solve n = bool "Lose" "Win" (dp ! n) where dp = foldl' f (V.replicate (n+1) True) [2 .. n] where f v x = let b = bool True False . and . map ((dp !) . (x -)) . takeWhile (<= x) $ primes in v // [(x, b)] primes :: [Int] primes = 2 : 3 : 5 : 7 : unfoldr f 11 where f x | isP x = Just (x, x+2) | otherwise = f (x+2) isP x = all ((/=0) . (mod x)) . takeWhile ((<= x) . (^ 2)) $ primes