using System; using System.Collections.Generic; using System.Text; public class Program { public void Proc(){ Reader.IsDebug = false; int max = int.Parse(Reader.ReadLine()); this.SetPrimeList(max); this.SetCanWinDic(max); bool ans = false; if(CanWin.ContainsKey(max)) { ans = this.CanWin[max]; } Console.WriteLine(ans?"Win":"Lose"); } private void SetCanWinDic(int max) { this.CanWin.Add(2, false); if(max >= 3) { this.CanWin.Add(3, false); } List keyList = new List(); keyList.AddRange(CanWin.Keys); foreach (int key in keyList) { foreach (int prime in this.PrimeList) { int newKey = key + prime; if(newKey <= max) { if(!CanWin.ContainsKey(newKey)) { CanWin.Add(newKey, true); } } else { break; } } } for(int i=4; i<=max; i++) { if(!CanWin.ContainsKey(i)) { // Console.WriteLine(i + ":" + this.PrimeList[this.NearPrimeIndex[i]]); bool hasWin = false; for(int j=0; j<=this.NearPrimeIndex[i]; j++) { int prime = this.PrimeList[j]; if(i - prime >= 2 && (!CanWin[i-prime])) { hasWin = true; } } CanWin.Add(i, hasWin); } } } private Dictionary CanWin = new Dictionary(); private List PrimeList = new List(); private int[] NearPrimeIndex; private void SetPrimeList(int max) { bool[] tempList = new bool[max+1]; this.NearPrimeIndex = new int[max + 1]; for(int i=2; i<=max; i++) { if(!tempList[i]) { PrimeList.Add(i); for(int j=1; j<=max / i; j++) { tempList[j*i] = true; } } this.NearPrimeIndex[i] = this.PrimeList.Count - 1; } } public static void Main(string[] args) { Program prg = new Program(); prg.Proc(); } } class Reader { public static bool IsDebug = true; private static System.IO.StringReader sr; public static string ReadLine() { if(IsDebug) { if(sr == null) { sr = new System.IO.StringReader(initStr.Trim()); } return sr.ReadLine(); } else { return Console.ReadLine(); } } public static int[] GetInt(char delimiter = ' ') { string[] inpt = ReadLine().Split(delimiter); int[] ret = new int[inpt.Length]; for(int i=0; i