#include<iostream>
using namespace std;
#define size 6
typedef struct node{
int num;
int value;
int amount;
}node;
node marble[size+1];
int total_value[size+1];
int cmp(const void*a,const void*b)
{
node *temp1=(node *)a;
node *temp2=(node *)b;
return ( temp1->amount - temp2->amount ) ;
}
inline int min(int a,int b)
{ if(a<=b) return a; else return b; }
bool dp[size+1][122];
void init()
{
int i,half,j,k;
int temp,temp1;
if(marble[1].num%2==0 && marble[2].num%2==0 && marble[3].num%2==0 && marble[4].num%2==0 && marble[5].num%2==0 && marble[6].num%2==0)
{
cout<<"Can be divided."<<endl;
return ;
}
if(marble[6].num>5) marble[6].num=marble[6].num%2 + 4;
if(marble[5].num>6) marble[5].num=6 - marble[5].num%2;
if(marble[4].num>5) marble[4].num=marble[4].num%2 + 4;
if(marble[3].num>5) marble[3].num=marble[3].num%2 + 4;
if(marble[2].num>4) marble[2].num=4 - marble[2].num%2;
if(marble[1].num>6) marble[1].num=6 - marble[1].num%2;
for(i=1;i<=6;i++)
{
marble[i].amount=marble[i].num * marble[i].value;
}
qsort(&marble[1],size,sizeof(marble[1]),cmp);
total_value[0]=0;
for(i=1;i<=6;i++)
total_value[i]=total_value[i-1]+marble[i].amount;
if(total_value[6]%2==1)
{
cout<<"Can't be divided."<<endl;
return;
}
//初始化第一行
half=total_value[6]/2;
for(j=1;j<=half;j++)
if( j/marble[1].value<=marble[i].num && j%marble[1].value==0)
dp[1][j]=true;
else dp[1][j]=false;
for(i=1;i<=6;i++) dp[i][0]=true;
for(i=2;i<=6;i++)
{
temp=min(total_value[i],half);
for(j=1;j<=temp;j++)
{
dp[i][j]=false;
temp1=min(marble[i].num,j/marble[i].value);
for(k=0;k<=temp1;k++)
if(dp[i-1][j-k*marble[i].value]==true)
{
dp[i][j]=true;
break;
}
}
for(j=temp+1;j<=half;j++)
{
dp[i][j]=false;
}
}
if(dp[6][half])
{
cout<<"Can be divided."<<endl;
return ;
}
else
{
cout<<"Can't be divided."<<endl;
return;
}
}
int main()
{
int i;
int test=1;
while(1)
{
for(i=1;i<=6;i++)
{
cin>>marble[i].num; marble[i].value=i;
}
if(marble[1].num==0 && marble[2].num==0 && marble[3].num==0 && marble[4].num==0 && marble[5].num==0 && marble[6].num==0)
break;
cout<<"Collection #"<<test++<<':'<<endl;
init();
cout<<endl;
}
return 0;
}