import math._ import scala.collection.mutable.ArrayBuffer object Main { def sieve(n: Int): Array[Int] = { val ar = Array.fill(n+1)(true) val primes = new ArrayBuffer[Int] primes.append(2) for (i <- 3 to n by 2) { if (ar(i)) { primes.append(i) for (j <- i+i to n by i) { ar(j) = false } } } primes.toArray } def calc(turn: Int, n: Int, primes: Array[Int]): Boolean = { if (n <= 1) { return turn == 0 } if (turn == 0) { for (x <- primes.takeWhile(e => e <= n).reverse) { val win = calc(1, n-x, primes) if (win) return true } false } else { for (x <- primes.takeWhile(e => e <= n).reverse) { val win = calc(0, n-x, primes) if (!win) return false } true } } def main(args: Array[String]) { val sc = new java.util.Scanner(System.in) val n = sc.nextInt val primes = sieve(n) if (calc(0, n, primes)) { println("Win") } else { println("Lose") } } }