#include using namespace std; using ll = long long; #ifdef LOCAL #include #define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__) #else #define debug(...) (static_cast(0)) #endif int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); string S, T; cin >> S >> T; // A, A, B, B, AB, O const map blood = {{"AA", "A"}, {"AO", "A"}, {"BB", "B"}, {"BO", "B"}, {"AB", "AB"}, {"OO", "O"}}; // A, B, AB, O map P; for (auto s : S) { for (auto t : T) { string data = string{s} + string{t}; if (data[0] > data[1]) swap(data[0], data[1]); for (auto [key, value] : blood) { if (data == key) { P[value] += 25; } } } } cout << P["A"] << " " << P["B"] << " " << P["AB"] << " " << P["O"] << '\n'; }