for _ in range(int(input())): n, m = map(int, input().split()) print('WIN' if (n-1) % (m+1) else 'LOSE')