/* Problem 4--7/11 Pricing
   This was the programming version of a math problem I posed when I was
   in college.  4 items add and multiply to 7.11; what are the costs of
   the items.  Although I didn't give that example on the sheet; it was
   one of the test cases.
   The trick was to work with integers to avoid round-off error.  And
   recursive trial-and-error solve the problem nicely. */

import java.io.*;
import java.util.*;

public class prob4 {

 public static Scanner in=null;
 public static PrintWriter out=null;

 public static void main (String[] args) throws Exception {

  in = new Scanner (new File ("prob4.in"));
  out = new PrintWriter ("prob4.out");
  int ct=0, cs=0;
  while ((ct=in.nextInt())!=-1) {
   double cost = in.nextDouble();
   out.print ("Case "+(++cs)+": ");
   int[] prices = findsumprod (ct, //find items with equal sum and prod
       (int)(100*cost+0.5),(int)(cost*Math.pow(100,ct)+0.5),1);
   for (int i=0; i < ct; i++) { //print the list
    out.print (prices[i]/100+".");
    if (prices[i]%100 < 10) out.print ("0");
    out.print (prices[i]%100);
    if (i < ct-1) out.print (", ");
   }
   out.println ();
   out.println ();
  }
  in.close();
  out.close();
 }

 /* findsumprod finds ct ints summing to s, multiplying to p, and whose
    lowest int is no less than start.  It returns the array of items if
    it worked, an empty array otherwise. */
 public static int[] findsumprod (int ct, int s, int p, int start) {

  if (ct==1) { // If there is only one item, s better equal p
   if (s==p) {return new int[] {s};}
   return new int[0];
  }
  for (int i=start; i <= s; i++) // Trial and error
   if (p%i==0) { // If i goes evenly into the product
    int[] prices=findsumprod (ct-1,s-i,p/i,i); // find the rest of them
    if (prices.length > 0) { // If it worked, build and return the array
     int[] mp = new int[ct];
     mp[0] = i;
     for (int j=1; j < ct; j++) mp[j] = prices[j-1];
     return mp;
    }
   }
  return new int[0]; // If nothing worked, return the empty array.
 }
}
