1. 

/**
* Problem: 11715 Car
* Zeit: 0.092
* Programmiersprache: JAVA
* @author Christoph Miesel
* Status: ACCEPTED
*/


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

public class Car
{
public static String r(double d)
{
d *= 1000;
long tmp = Math.round(d);
d = (double)tmp / 1000;
boolean flag = false;
String s = "";

s += d;
int counter = 0;
for(int i = 0; i < s.length(); i++)
{
if(flag)
counter++;
if(s.charAt(i) == '.')
flag = true;
}
for(int i = 0; i < (3 - counter); i++)
s += "0";

return s;
}

public static void main(String[] args)throws IOException
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String line = reader.readLine();

long tmp;
double u,v,a,t,s;
int c,counter; //case
StringTokenizer token = new StringTokenizer(line);
counter = 0;
while(true)
{
c = Integer.parseInt(token.nextToken());
if(c == 0)
break;
switch(c)
{
case 1:
u = Double.parseDouble(token.nextToken());
v = Double.parseDouble(token.nextToken());
t = Double.parseDouble(token.nextToken());
s = u*t+0.5*(v-u)*t;
a = (v-u)/t;
++counter;

System.out.println("Case "+counter+": "+r(s)+" "+r(a));
break;
case 2:
u = Double.parseDouble(token.nextToken());
v = Double.parseDouble(token.nextToken());
a = Double.parseDouble(token.nextToken());
t = (v - u)/a;
s = u*t + 0.5*a*t*t;
++counter;
System.out.println("Case "+counter+": "+r(s)+" "+r(t));
break;
case 3:
u = Double.parseDouble(token.nextToken());
a = Double.parseDouble(token.nextToken());
s = Double.parseDouble(token.nextToken());
t = -u/a + Math.sqrt(u*u + 2*a*s)/a;
if(-u/a - Math.sqrt(u*u + 2*a*s)/a > t)
t = -u/a - Math.sqrt(u*u + 2*a*s)/a;
v = a*t + u;
++counter;
System.out.println("Case "+counter+": "+r(v)+" "+r(t));
break;
case 4:
v = Double.parseDouble(token.nextToken());
a = Double.parseDouble(token.nextToken());
s = Double.parseDouble(token.nextToken());
u = Math.sqrt(v*v - 2*a*s);
t = s/(u+0.5*(v-u));
++counter;
System.out.println("Case "+counter+": "+r(u)+" "+r(t));
break;
}
line = reader.readLine();
token = new StringTokenizer(line);
}
}
}