#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long LL; typedef unsigned long long ULL; #define MEM(a,b) memset((a),(b),sizeof(a)) const LL INF = 1e9 + 7; const int N = 2e5 + 10; int main() { //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); string s1, s2; cin >> s1 >> s2; map ms; for (auto& c1 : s1) { for (auto& c2 : s2) { char a = c1; char b = c2; if (a > b) swap(a, b); string s; s += a; if (a != b && b != 'O') s += b; ms[s] += 25; } } cout << ms["A"] << ' ' << ms["B"] << ' ' << ms["AB"] << ' ' << ms["O"] << endl; return 0; }