use std::io::*; use std::str::FromStr; use utils::*; pub fn main() { let i = stdin(); let mut o = Vec::new(); run(i.lock(), &mut o); stdout().write_all(&o).unwrap(); } fn run(i: R, o: &mut W) { let mut i = ReadEx::from(i); let n = i.read::(); let r = if solve(n) { "Win" } else { "Lose" }; writeln!(o, "{}", r).unwrap(); } fn solve(n: usize) -> bool { fn is_prime(n: usize, primes: &[usize]) -> bool { for &p in primes { if n % p == 0 { return false; } } true }; let mut primes = Vec::new(); for n in 2..n + 1 { if is_prime(n, &primes) { primes.push(n); } } fn is_win(n: usize, memo: &mut [Option], primes: &[usize]) -> bool { if n < 2 { return true; } if let Some(r) = memo[n] { return r; } let r = primes .iter() .take_while(|&&p| p <= n) .any(|p| !is_win(n - p, memo, primes)); memo[n] = Some(r); r } let mut memo = vec![None; n + 1]; is_win(n, &mut memo, &primes) } mod utils { use super::*; pub struct ReadEx { r: R, s: String, } impl ReadEx { pub fn from(r: R) -> Self { ReadEx { r: r, s: String::new(), } } pub fn read_line(&mut self) -> &str { self.s.clear(); self.r.read_line(&mut self.s).unwrap(); self.s.trim() } pub fn read(&mut self) -> T { self.read_line().parse().ok().unwrap() } } }