//David Malec
//UVA problem Maximum Product

#include <iostream>

using namespace std;

int main()
{
    int N;
    int nums[18];
    long long prod; //current product
    long long best; //best product

    int casen = 0;

    while(cin >> N && N > 0)
    {
	casen++;
	for(int i = 0; i < N; i++)
	    cin >> nums[i];
	
	//problem states that if best is negative,
	//we should consider it to be zero instead.
	best = 0;
	prod = 0;
	
	//best product must come from a region containing no zeros,
	//and containing an even number of negative numbers;
	//otherwise, since all numbers are integers, 
	//more numbers are always better.
	//so, for any region without zeros, we want the whole thing,
	//or everything before the last zero, or everything after the first zero
	//we make two passes to get the last two.
	for(int i = 0; i < N; i++)
	{
	    if(prod == 0)
		prod = nums[i];
	    else
		prod *= nums[i];
	    if(prod > best)
		best = prod;
	}

	prod = 0;
	for(int i = N-1; i >= 0; i--)
	{
	    if(prod == 0)
		prod = nums[i];
	    else
		prod *= nums[i];
	    if(prod > best)
		best = prod;
	}

	cout << "Case #" << casen 
	     << ": The maximum product is " << best << "."
	     << endl << endl;
	
    }
}

