// Arup Guha
// 2/22/2014
// Solution to 2013 Greater NY Regional Problem F: Chomp

import java.util.*;

public class f {

	final public static int MAX = 100;

	public static void main(String[] args) {

		// Here is our memo array.
		pair[][][] ans = new pair[MAX+1][MAX+1][MAX+1];
		for (int i=0; i<=MAX; i++)
			for (int j=0; j<=MAX; j++)
				Arrays.fill(ans[i][j], null);

		// Go through each possible call.
		for (int small=0; small<=MAX; small++) {
			for (int mid=small; mid<=MAX; mid++) {
				for (int big=mid; big<=MAX; big++) {

					// Special case.
					if (small == 0 && mid == 0) {
						if (big == 0) ans[small][mid][big] = new pair(0,1);
						if (big > 1) ans[small][mid][big] = new pair(2, 1);
					}

					// Build off old cases.
					else {

						pair best = null;

						// Try to win in row 3.
						for (int col=small-1; col>=0; col--) {
							if (ans[col][mid][big] == null) {
								pair tmp =  new pair(col+1,3);
								if (best == null || tmp.compareTo(best) < 0) best = tmp;

							}
						}

						// If you didn't, try to win in row 2.
						for (int col=mid-1; col>=0; col--) {
							if (ans[Math.min(small,col)][col][big] == null) {
								pair tmp = new pair(col+1,2);
								if (best == null || tmp.compareTo(best) < 0) best = tmp;

							}
						}

						// Then row 1...
						for (int col=big-1; col>=0; col--) {
							if (ans[Math.min(small,col)][Math.min(mid,col)][col] == null) {
								pair tmp = new pair(col+1,1);
								if (best == null || tmp.compareTo(best) < 0) best = new pair(col+1,1);

							}
						}

						ans[small][mid][big] = best;

					}
				}
			}
		} // end small.


		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();

		// Go through each case.
		for (int loop=1; loop<=numCases; loop++) {

			// Read in data.
			int caseNum = stdin.nextInt();
			int big = stdin.nextInt();
			int mid = stdin.nextInt();
			int small = stdin.nextInt();
			System.out.print(loop+" ");
			if (ans[small][mid][big] != null)
				System.out.println("W "+ans[small][mid][big]);
			else
				System.out.println("L");

		}
	}
}

class pair implements Comparable<pair> {

	public int col;
	public int row;

	public pair(int c, int r) {
		col = c;
		row = r;
	}

	public String toString() {
		return col+" "+row;
	}

	public int compareTo(pair other) {
		if (this.row != other.row) return this.row - other.row;
		return this.col - other.col;
	}
}