#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,tc,i,j,c,b,w,t,a;
string s;
//freopen("banglawash.txt","r",stdin);
//freopen("banglawashout.txt","w",stdout);
cin>>tc;
for(i=1;i<=tc;i++)
{
cin>>n;
cin>>s;
c=n;
b=0;
w=0;
t=0;
a=0;
for(j=0;j<s.length();j++)
{
if(s[j]=='B')
{
b++;
}
else if(s[j]=='W')
{
w++;
}
else if(s[j]=='T')
{
t++;
}
else if(s[j]=='A')
{
a++;
n--;
}
}
if(b==n && b!=0)
{
printf("Case %d: BANGLAWASH\n",i);
}
else if(w==n && w!=0)
{
printf("Case %d: WHITEWASH\n",i);
}
else if(b>w)
{
printf("Case %d: BANGLADESH %d - %d\n",i,b,w);
}
else if(w>b)
{
printf("Case %d: WWW %d - %d\n",i,w,b);
}
else if(b==w && a!=c)
{
printf("Case %d: DRAW %d %d\n",i,b,t);
}
else if(a==c)
{
printf("Case %d: ABANDONED\n",i);
}
}
return 0;
}
0 comments:
Post a Comment