#include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); string s,t; cin >> s >> t; vector answer(4); for(auto c : s) for(auto c2 : t){ set S = {c,c2}; if(S.count('A') && !S.count('B')) answer.at(0) += 25; else if(S.count('B') && !S.count('A')) answer.at(1) += 25; else if(S.count('A') && S.count('B')) answer.at(2) += 25; else answer.at(3) += 25; } for(int i=0; i<4; i++) cout << answer.at(i) << (i==3?"\n":" "); }