#!/usr/bin/env python3 # -*- coding: utf-8 -*- import functools import itertools def mex(s): if not s: return 0 else: for i in itertools.count(): if i not in s: return i def can_i_win(n, k): @functools.lru_cache() def compute_grundy_number(current_number): new_numbers = range(current_number + 1, min(n, current_number + k + 1)) gs = set(map(compute_grundy_number, new_numbers)) return mex(gs) return compute_grundy_number(0) != 0 def main(): p = int(input()) for _ in range(p): n, k = map(int, input().split()) print("Win" if can_i_win(n, k) else "Lose") if __name__ == '__main__': main()