#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define endl '\n' #define all(v) (v).begin(), (v).end() #define uniq(v) (v).erase(unique((v).begin(), (v).end()), (v).end()) typedef long long ll; typedef pair P; typedef unsigned int uint; const int inf = 1000000009; int memo[120010]; bool solve(int n, int k) { if (n <= 0) return true; if (memo[n] == 0) { bool win = false; for (int i = max(0, n-k); !win && i < n; i++) { win = (win || !solve(i, k)); } memo[n] = (win ? 1 : -1); } return memo[n] > 0; } int main() { int p; scanf("%d", &p); for (int i = 0; i < p; i++) { int n, k; scanf("%d%d", &n, &k); memset(memo, 0, sizeof(memo)); printf("%s\n", solve(n, k) ? "Win" : "Lose"); } }