import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int[] a = new int[n * 2]; for (int i = 0; i < n*2; i++) { a[i] = scanner.nextInt(); } for (int i = 0; i < n * 2; i += 2) { int ans = a[i] - 1; while (ans > a[i + 1]) { ans -= a[i+1]; } if (ans > 0 && ans > a[i+1]) { System.out.println("win"); } else { System.out.println("lose"); } } } }