// Arup Guha
// 11/6/2014
// Solution to 2005 UCF High School Problem: The Law of Signs

// Note: There is a slight error in the posted judge output on case #31. Angle 1 is given as
//       26.685. When it displays, it ought to print as 28.69, which is what my program does.
//       The judge output shows 26.68, which is not rounded correctly. This probably never came
//       up in contest because no team submitted it with only that error and all three judge
//       solutions happened to agree. This is probably a strong argument for allowing for
//       tolerances in output instead of fixing the digits and expecting a perfect match.
//       Very random things cause this slight discrepancies that ultimately aren't the crux
//       of what we care about in the solution to the problem.

import java.util.*;

public class signs {

	// Our constants
	final public static int ITEMS = 6;
	final public static double PI = 3.14159;
	final public static double RAD_PER_DEG = PI/180;
	final public static double DEG_PER_RAD = 180/PI;
	final public static int SUM_DEGREES = 180;
	final public static double TINY = 1e-9;
	final public static double EPSILON = 1e-2+TINY;


	// Triangle we are trying to solve is accessible to every method.
	public static double[] angles;
	public static double[] sides;

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		angles = new double[3];
		sides = new double[3];

		// Read first case.
		readThree(angles,stdin);
		readThree(sides,stdin);
		int loop = 1;

		// Go through each case.
		while (cntGiven(angles, sides) > 0) {

			// Use 180 rule before general solution.
			if (cntGiven(angles) == 2) fillLastAngle(angles);

			// Not enough data.
			if (nomatch(angles, sides) || cntGiven(angles, sides) < 3)
				System.out.println("Sign #"+loop+": Lost!");

			// Solve, assuming acute angles.
			else {

				populate(angles, sides);

				// Got a valid solution.
				if (validAngles(angles) && cntGiven(angles, sides) == ITEMS && consistent(angles,sides))
					System.out.printf("Sign #%d: %.2f %.2f %.2f %.2f %.2f %.2f\n", loop, angles[0], angles[1], angles[2], sides[0], sides[1], sides[2]);

				// Doesn't work due to angles.
				else {
				//	print(angles);
				//	print(sides);
					System.out.println("Sign #"+loop+": Rejected!");
				}
			}

			// Get next case.
			readThree(angles,stdin);
			readThree(sides,stdin);
			loop++;
		}
	}

	// Reads three items from stdin into array[0..2].
	public static void readThree(double[] array, Scanner stdin) {
		for (int i=0; i<3; i++)
			array[i] = stdin.nextDouble();
	}

	// Returns truef if we have no matching angle length information.
	public static boolean nomatch(double[] angles, double[] sides) {
		for (int i=0; i<angles.length; i++)
			if (angles[i] > 0 && sides[i] > 0)
				return false;
		return true;
	}

	// Returns number of items in array > 0.
	public static int cntGiven(double[] array) {
		int cnt = 0;
		for (int i=0; i<array.length; i++)
			if (array[i] > 0)
				cnt++;
		return cnt;
	}

	// Returns number of items in both arrays > 0.
	public static int cntGiven(double[] angles, double[] sides) {
		return cntGiven(angles) + cntGiven(sides);
	}

	// Finds missing angle and makes it difference from 180 of the rest.
	public static void fillLastAngle(double[] angles) {
		double ans = 0;
		int index = -1;
		for (int i=0; i<angles.length; i++) {
			if (angles[i] < 0) 	index = i;
			else				ans += angles[i];
		}
		angles[index] = SUM_DEGREES - ans;
	}

	// Checks sum equal 180 AND acute angles.
	public static boolean validAngles(double[] angles) {
		double sum = 0;
		for (int i=0; i<angles.length; i++) {
			if (angles[i] >= SUM_DEGREES/2-EPSILON) return false;
			sum += angles[i];
		}
		return Math.abs(sum - SUM_DEGREES) < EPSILON;
	}

	public static boolean populate(double[] angles, double[] sides) {

		// Find ratio of side/sin(side).
		int match = getMatch(angles, sides);
		double ratio = sides[match]/Math.sin(angles[match]*RAD_PER_DEG);

		// Apply ratio to all other pieces.
		while (cntGiven(angles, sides) < ITEMS) {

			// Need to check this again.
			if (cntGiven(angles) == 2) fillLastAngle(angles);

			// Get the index of a combo for which info is missing.
			int missing = getMissing(angles, sides);
		//	System.out.println("missing item is "+missing);

			// Tricky case - asin might be impossible...
			if (angles[missing] < 0) {
				if (Math.abs(sides[missing]/ratio) > 1+EPSILON || sides[missing]/ratio < -EPSILON) return false;
				angles[missing] = Math.asin(sides[missing]/ratio)*DEG_PER_RAD;

			}
			else if (sides[missing] < 0)
				sides[missing] = ratio*Math.sin(angles[missing]*RAD_PER_DEG);

		//	print(angles);
		//	print(sides);
		//	System.out.println();
		}
		return true;
	}

	public static void print(double[] array) {
		for (int i=0; i<array.length; i++)
			System.out.print(array[i]+" ");
	}

	// Returns the first index for which we have matching information in angles and sides.
	public static int getMatch(double[] angles, double[] sides) {
		for (int i=0; i<angles.length; i++)
			if (angles[i] > 0 && sides[i] > 0)
				return i;
		return 0; // Should never get here.
	}

	// Returns the first index for which we have matching information in angles and sides.
	public static int getMissing(double[] angles, double[] sides) {
		for (int i=0; i<angles.length; i++)
			if ((angles[i] < 0 || sides[i] < 0) && !(angles[i] < 0 && sides[i] < 0))
				return i;
		return 0; // Should never get here.
	}

	public static boolean consistent(double[] angles, double[] sides) {
	//	System.out.print("in cons ");

		for (int i=0; i<angles.length; i++) {
			for (int j=i+1; j<angles.length; j++) {
				double r1 = sides[i]/Math.sin(angles[i]*RAD_PER_DEG);
				double r2 = sides[j]/Math.sin(angles[j]*RAD_PER_DEG);
//				System.out.print(r1+" "+r2+" ");
				if (Math.abs(r1-r2) > EPSILON)
				return false;
			}
		}
		return true;
	}
}