#include<iostream>
#include<vector>
using namespace std;
int main()
{
int n,k,num=0;
long long tmp, max;
vector<int> v;
while (cin >> n) {
num += 1;
max = 0;
for (int i = 0; i < n; i++) {
cin >> k;
v.push_back(k);
}
for (int i = 0; i < n; i++) {
tmp = 1;
for (int j = i; j < n; j++) {
tmp *= (long long)v[j];
if (tmp > max) {
max = tmp;
}
}
}
cout << "Case #"<<num<<": The maximum product is " << max << endl;
}
}