#include #include #include #include #include #include #include #include #include using namespace std; int main() { int P; cin >> P; int N, K; for (int l = 0; l < P; ++l) { cin >> N >> K; vector v(N + K + 1, 0); v[N] = 0; set s1; for (int k = 0; k <= K; ++k) { s1.insert(k); } for (int i = N - 1; i >= 0; --i) { set s2; for (int j = 1; j <= K; ++j) { s2.insert(v[i + j]); } set r; set_difference(s1.begin(), s1.end(), s2.begin(), s2.end(), std::inserter(r, r.end())); v[i] = *r.begin(); } if (v[1] == 0) { cout << "Lose" << "\n"; } else { cout << "Win" << "\n"; } } return 0; }