#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { string s, t; cin >> s >> t; int a = 0, b = 0, o = 0, ab = 0; rep(i, 2) rep(j, 2) { set st = { s[i], t[j] }; if (st.contains('A') && st.contains('B')) ab++; else if (st.contains('A')) a++; else if (st.contains('B')) b++; else o++; } printf("%d %d %d %d\n", a * 25, b * 25, ab * 25, o * 25); return 0; }