#include <iostream>
using namespace std;

int main(){
  int q=1;
  string str[]={"OK","Cannot pay some amount","Cannot use greedy algorithm"};
  while(1){
    int n;
    cin >> n;
    if(n==0) break;
    int ans =0,c[51];
    for(int i=0;i<n;i++)cin >> c[i];
    if(c[0] !=1) ans=1;
    for(int i=2;i<n;i++){
      if(ans!=0) break;
      int t=0,j=i,sum=0;
      while(j>=0&&c[i]%c[j]==0)j--;
      if(j<0)continue;
      t=(c[i]/c[j]+1)*c[j];
      int k=n-1;
      while(t)sum+=t/c[k],t%=c[k--];
      if(c[i]/c[j]+1 <sum)ans=2;
    }
    cout << "Case #"<<q++<<": "<<str[ans]<<endl;
  }
return 0;
}