import qualified Data.Map as M type Table = M.Map Int Bool main = do n <- read <$> getLine putStrLn $ if snd $ battle M.empty n then "Win" else "Lose" primesLeqN :: Int -> [Int] primesLeqN n = sieve [2..n] where sieve [] = [] sieve (n:ns) = n:sieve [m|m<-ns,mod m n/=0] {-battle :: Int -> Bool battle n | n <= 1 = True | otherwise = lookup not $ and $ battle <$> ((n-) <$> primesLeqN n)-} battle :: Table -> Int -> (Table,Bool) battle tbl n | n <= 1 = (tbl,True) | otherwise = case M.lookup n tbl of Just b -> (tbl,b) Nothing -> (M.insert n (not rslt) tbl',not rslt) where (tbl',rslt) = battleAux tbl n $ primesLeqN n battleAux tbl n [] = (tbl,True) battleAux tbl n (p:ps) = (tbl'',b && rslt') where (tbl''',b) = battle tbl (n-p) (tbl'',rslt') = battleAux tbl''' n ps