#include<bits/stdc++.h>
using namespace std;
const int X=1000;
char team[X];
void SOLVE(int n,int m)
{
int one=0,zero=0;
if(m<n) return;
for(int i=n;i<=m;i++)
{
if(team[i]=='0') ++zero;
else ++one;
}
if(one==0) cout<<'A';
else if(zero==0) cout<<'B';
else
{
cout<<'C';
SOLVE(n,(n+m)/2);
SOLVE((n+m)/2+1,m);
}
return;
}
int main()
{
gets(team);
SOLVE(0,strlen(team)-1);
cout<<endl;
system("pause");
return 0;
}