#include #include #include #include #include #include #include #include #include // require sort next_permutation count __gcd reverse etc. #include // require abs exit atof atoi #include // require scanf printf #include #include // require accumulate #include // require fabs #include #include #include #include // require setw #include // require stringstream #include // require memset #include // require tolower, toupper #include // require freopen #include // require srand #define rep(i,n) for(int i=0;i<(n);i++) #define ALL(A) A.begin(), A.end() /* No.7 プライムナンバーゲーム メモ化再帰 */ using namespace std; typedef long long ll; typedef pair P; const int MAX_N = (int)1e4 + 4; bool p[MAX_N]; vector prime; void sieve (void ){ fill (p, p+MAX_N, true ); p[0] = false; p[1] = false; for (int i = 2; i < MAX_N; i++ ){ if (p[i] ){ for (int j = 2*i; j < MAX_N; j += i ) p[j] = false; } // end if } // end for prime.clear(); for (int i = 2; i < MAX_N; i++ ) if (p[i] ) prime.push_back (i ); } int memo[MAX_N]; int dfs (int curr ){ if (memo[curr] != -1 ) return memo[curr]; // 移動先で1つでも負けパターンがあれば勝ち、そうでなければ負け bool res = false; for (int i = 0; prime[i] <= curr && i < prime.size(); i++ ){ int next = curr - prime[i]; res |= !dfs (next ); } // end for return memo[curr] = (int)res; } int main() { memset (memo, -1, sizeof(memo ) ); sieve(); memo[0] = true; memo[1] = true; ios_base::sync_with_stdio(0); int N; cin >> N; dfs (N ); cout << (memo[N] ? "Win": "Lose" ) << endl; return 0; }