#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; bool rcmp(int a, int b) { return a>b; } typedef long long LL; class mypcmp { public: bool operator()(const int& a, const int& b) { return a=0; i--) { b=ib[i]-'A'; if (a==b) continue; for (k=0; k<3; k++) if (a!=k&&b!=k) break; r+=bb[i]; r%=MOD; a=k; } printf("%d\n", r); return 0; }