// Arup Guha
// 7/20/04
// Solution to 2004 BHCSI Programming Contest Problem Classroom

import java.io.*;
import java.util.*;
import java.text.DecimalFormat;

public class classroom {


  public static void main(String[] args) throws IOException {

    BufferedReader fin = new BufferedReader(new FileReader("classroom.in"));

    DecimalFormat fmt = new DecimalFormat("#.00");

    // Read in the number of cases.
    int n = Integer.parseInt(fin.readLine().trim());

    // Loop through each case.
    for (int casenum=1; casenum <=n; casenum++) {

      // Read the number of commands.
      int c = Integer.parseInt(fin.readLine().trim());

      // Set Eric up at home. Angle is measured counter-clockwise with
      // respect to the positive x-axis, as it usually is in math.
      double angledeg = 0;
      double x = 0, y = 0;

      //Read in the data.
      for (int linenum=0; linenum<c; linenum++) {

        // Parse out the command and argument.
        StringTokenizer tok = new StringTokenizer(fin.readLine());
        String command = tok.nextToken();
        double argument = Double.parseDouble(tok.nextToken());

        // A left turn adds to the angle.
        if (command.equals("Left"))
          angledeg += argument;

        // A right turn subtracts from the angle.
        else if (command.equals("Right"))
          angledeg -= argument;

        // Translate the current point x,y accordingly, using x and y
        // components based on the magnitude and angle of walking.
        else {
          x += argument*Math.cos(getRadians(angledeg));
          y += argument*Math.sin(getRadians(angledeg));
        }

        // Make sure the angle is in the 0 to 360 range.
        if (angledeg < 0) angledeg += 360;
        if (angledeg > 360) angledeg -= 360;
      }

      // Calculate the vector to get to the Honors College.
      double xdiff = 100 - x;
      double ydiff = -y;

      // Get the angle to get to the Honors College.
      double anglehome = getAngle(xdiff, ydiff);

      System.out.println("Directions for Data Set #"+casenum);

      // Only print out the first command if the angle is big enough.
      if (Math.abs(angledeg-anglehome) > 0.01) {

        // Set the angle for the turn in between -180 and 180.

        double anglediff = angledeg - anglehome;
        if (anglediff > 180) anglediff -= 360;
        if (anglediff < -180) anglediff += 360;

        // Special case for the Left 180 turn.
        if (anglediff == 180) anglediff = -180;

        // Print out the appropriate term. There's a redundant check on
        // size of the angle before it's printed.
        if (anglediff > 0.01)
          System.out.println("Right "+fmt.format(anglediff));
        else if (anglediff < -0.01)
          System.out.println("Left "+fmt.format(-anglediff));
      }

      // Calculate how far Eric is and command him to walk that far.
      double dist = Math.sqrt(xdiff*xdiff+ydiff*ydiff);
      System.out.println("Walk "+fmt.format(dist)+"\n");
    }

  }

  // Returns the angle measure of degrees in radians.
  public static double getRadians(double degrees) {
    return degrees*Math.PI/180;
  }

  // Computes the angle of the vector defined by x and y in between
  // 0 and 360.
  public static double getAngle(double x, double y) {

    // Return the cardinal directions.
    if (x > 0 && y == 0) return 0;
    if (x < 0 && y == 0) return 180;
    if (x == 0 && y > 0) return 90;
    if (x == 0 && y < 0) return 270;

    // Return the normal cases, using the appropriate angle based on
    // whether it is less than or greater than 180.
    double dist = Math.sqrt(x*x+y*y);
    if (y > 0) return 180*Math.acos(x/dist)/Math.PI;
    else return 360 - 180*Math.acos(x/dist)/Math.PI;
  }
}
