#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); string a; cin>>a; reverse(ALL(a)); int t=1; int q=0; for(int i=0;i<3;i++){ q+=(a[i]-'0')*t; t*=10; } t=1000; for(int i=4;i<(int)a.size();i++){ q+=(a[i]-'0')*t; t*=10; } int b=q; int p=1000; int g=gcd(p,q); p/=g,q/=g; if(p%2==1 && q%2==0) cout<<'B'; else if(p%2==0 && q%2==1) cout<<'C'; else cout<<'A'; cout<<" "<