include<stdio.h>
main()
{int n,a=0,b=0,c=0,t=0,Tot=0,tag;
char flag='A';
while(scanf("%d",&n),n!=-1)
{switch(n)
{case 1:a++;Tot++;break;
case 2:b++;Tot++;break;
case 3:c++;Tot++;break;}}
printf("A=%d\n",a);
printf("B=%d\n",b);
printf("C=%d\n",c);
printf("Tot=%d\n",Tot);
Tot++;
if(a>Tot/2)
{printf("A-yes");}
else
{if(b>Tot/2)
{printf("B-yes");}
else
{if(c>Tot/2)
{printf("C-yes");}
else
{printf("all-NO");}}}}