#include <bits/stdc++.h>
using namespace std;
long long a[20],b[300];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n,z=0;
while(cin>>n){
z++;
for(int i=0;i<n;i++){cin>>a[i];}
int t=0;
for(int i=0;i<n;i++){
long long x=1;
for(int k=i;k<n;k++){
x*=a[k];
b[t]=x;
t++;}
}
sort(b,b+t);
if(b[t-1]<0){cout<<"Case #"<<z<<": The maximum product is "<<0<<"."<<endl;}
else{cout<<"Case #"<<z<<": The maximum product is "<<b[t-1]<<"."<<endl;}
cout<<endl;
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmxvbmcgbG9uZyBhWzIwXSxiWzMwMF07CmludCBtYWluKCkgewoJaW9zOjpzeW5jX3dpdGhfc3RkaW8oMCk7CgljaW4udGllKDApOwoJaW50IG4sej0wOwoJd2hpbGUoY2luPj5uKXsKCQl6Kys7CgkJZm9yKGludCBpPTA7aTxuO2krKyl7Y2luPj5hW2ldO30KCQlpbnQgdD0wOwoJCWZvcihpbnQgaT0wO2k8bjtpKyspewoJCQkKCQkJCgkJCQkKCQkJCWxvbmcgbG9uZyB4PTE7CgkJCQlmb3IoaW50IGs9aTtrPG47aysrKXsKCQkJCQl4Kj1hW2tdOwoJCQkJCQliW3RdPXg7CgkJCQkKCQkJCXQrKzt9CgkJCQkKCQkJCgkJCQoJCQkKCQl9CgkJc29ydChiLGIrdCk7CgkJaWYoYlt0LTFdPDApe2NvdXQ8PCJDYXNlICMiPDx6PDwiOiBUaGUgbWF4aW11bSBwcm9kdWN0IGlzICI8PDA8PCIuIjw8ZW5kbDt9CgkJZWxzZXtjb3V0PDwiQ2FzZSAjIjw8ejw8IjogVGhlIG1heGltdW0gcHJvZHVjdCBpcyAiPDxiW3QtMV08PCIuIjw8ZW5kbDt9CgkJY291dDw8ZW5kbDsKCX0KCQp9