#include using namespace std; typedef long long ll; typedef pair p_ll; template void debug(T itr1, T itr2) { auto now = itr1; while(now=0; i--) #define popcount __builtin_popcount const ll LLINF = pow(2,61)-1; const ll INF = pow(2,30)-1; ll gcd(ll a, ll b) { if (a> a; ll x = a * 1000, y = 1000; assert(1<=y<=pow(10,6)); ll g = gcd(x, y); x /= g; y /= g; string v = (x+y)%2==0 ? "A" : x%2==0 ? "B" : "C"; ll result = (x-1) + (y-1) + (x+y)/2 + abs(x-y)/2; cout << v << " " << result << endl; return 0; }