#include <iostream>
using namespace std;
const int N = 18;
int max(int a,int b)
{
return a>b?a:b;
}
int main(void)
{
int t = 0;
int n, a[N];
while (scanf("%d",&n)!= EOF && n) {
for (int i = 0; i < n; i ++)
scanf("%d", &a[i]);
long res = a[0];
for (i = 0; i < n; i ++) {
long int mult = 1;
for (int j = i; j < n; j ++) { //关键语句,遍历所有的序列
mult *= a[j];
res = max(mult, res);
}
}
if (res < 0) res = 0;
printf("Case #%d: The maximum product is %lld.\n\n", ++t, res);
}
return 0;
}