#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x>N; grundy[1]=0; for(i=2;i<=100;i++) { set s; s.insert(grundy[i/2]^grundy[(i+1)/2]); if(i>=3) s.insert(grundy[i/3]^grundy[(i+1)/3]^grundy[(i+2)/3]); while(s.count(grundy[i])) grundy[i]++; } if(grundy[N]!=0) cout<<"A"<