import java.util.*;
import java.io.*;
import java.text.*;

public class F_j
{
	static final int SIZE = 50;

	static double [] prob = new double[SIZE+3];
	static double [] temp = new double[SIZE+3];
	static double [] lose = new double[SIZE+3];
	static double [] tempLose = new double[SIZE+3];
	static double [] delay = new double[SIZE+3];
	static boolean [] loseTurn = new boolean[SIZE+3];
	static int [] squares = new int[SIZE+3];
	static DataInputStream in = new DataInputStream(System.in);
	static String line = "";


	public static void main(String [] args)
	{
		try {
			line = in.readLine();
		} catch (IOException ioe) {}
		StringTokenizer str = new StringTokenizer(line);
		int nCase = Integer.parseInt(str.nextToken());
		for(int cases=1; cases<=nCase; cases++) {
			try {
				line = in.readLine();
			} catch (IOException ioe) {}
			str = new StringTokenizer(line);
			int m = Integer.parseInt(str.nextToken());
			int t = Integer.parseInt(str.nextToken());
			for(int i=0; i<m+3; i++) {
      				loseTurn[i] = false;
			}
			line = null;
			try {
				line = in.readLine();
			} catch (IOException ioe) {}
			str = new StringTokenizer(line);

								// get list of commands
			for(int i=1; i<=m; i++) {
				String s = str.nextToken();
				if (s.charAt(0) == '0')
   					squares[i] = 0;
				else if (s.charAt(0) == 'L') {
   					loseTurn[i] = true;
					squares[i] = 0;
				}
				else if (s.charAt(0) == '+')
					squares[i] = Integer.parseInt(s.substring(1,s.length()));
				else
					squares[i] = -Integer.parseInt(s.substring(1,s.length()));
			}
			squares[m+1] = squares[m+2] = 0;

			for(int i=0; i<m+3; i++) {
      			prob[i] = 0;
				lose[i] = 0;
				delay[i] = 0;
			}
			prob[0] = 1;

								// determine probs for being in each
								// square after each turn
			for(int turn=1; turn<=t; turn++) {
				for(int i=0; i<m+3; i++) {
         			tempLose[i] = temp[i] = 0.0;
				}
				for(int i=0; i<m+1; i++) {
         			if (loseTurn[i+1])
            			tempLose[i+1] += 0.5*(prob[i] + lose[i]);
					else
            			temp[i+1+squares[i+1]] += 0.5*(prob[i]+lose[i]);
         			if (loseTurn[i+2])
            			tempLose[i+2] += 0.5*(prob[i] + lose[i]);
					else
            			temp[i+2+squares[i+2]] += 0.5*(prob[i]+lose[i]);
				}
				for(int i=0; i<m+1; i++) {
         			prob[i] = temp[i];
					lose[i] = delay[i];			// introduce one move delay for Lose Turn squares
					delay[i] = tempLose[i];
				}
				prob[m+1] += temp[m+1] + temp[m+2];
		    }
			if (prob[m+1] > 0.5)
		      	System.out.print("Bet for. ");
			else if (prob[m+1] < 0.5)
      			System.out.print("Bet against. ");
			else
      			System.out.print("Push. ");
			DecimalFormat out = new DecimalFormat("0.0000");
			System.out.println(out.format(prob[m+1]));
		}	
	}
}
