#include using namespace std; int main() { string s, t; cin >> s >> t; int n = s.size(), m = t.size(); vector c(4, 0); for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { string x = ""; x += s[i]; x += t[j]; sort(x.begin(), x.end()); if (x == "AA" || x == "AO") c[0]++; else if (x == "BB" || x == "BO") c[1]++; else if (x == "AB") c[2]++; else c[3]++; } } int su = 0; for (int i = 0; i < 4; i++) su += c[i]; for (int i = 0; i < 4; i++) { cout << c[i] * 100 / su << " \n"[i == 4 - 1]; } return 0; }