#include #include #include #include #include #include #include #include #include #include using namespace std; #define rep(i, n) for (int i = 0;i < (n); ++i) #define Yes cout << "Yes" << endl #define No cout << "No" << endl #define vi vector #define vvi vector> #define vl vector #define vvl vector> #define vs vector #define vc vector #define vvc vector> #define vb vector #define vvb vector> using ll = long long; using P = pair; void chmin(ll &a,ll b){ a = min(a,b); } void chmax(int &a,int b){ a = max(a,b); } const ll INF = 2e18; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); string s,t; cin >> s >> t; int aa = 0;int ab = 0;int bb = 0;int o = 0; for(int i = 0;i < 2;i++){ for(int j = 0;j < 2;j++){ if(s[i] == 'A' && t[j] == 'A')aa++; else if(s[i] == 'A' && t[j] == 'B')ab++; else if(s[i] == 'B' && t[j] == 'A')ab++; else if(s[i] == 'B' && t[j] == 'B')bb++; else if(s[i] == 'O' && t[j] == 'A' || s[i] == 'A' && t[j] == 'O')aa++; else if(s[i] == 'O' && t[j] == 'B' || s[i] == 'B' && t[j] == 'O') bb++; else o++; } } cout << aa*25 << " " << bb*25 << " " << ab*25 << " " << o*25 << endl; return 0; }