#include using namespace std; char findnw(char c1,char c2) { if ((c1 == 'A' && c2 != 'B') || (c1 != 'B' && c2 == 'A')) { return 'A'; } else if ((c1 == 'B' && c2 != 'A') || (c1 != 'A' && c2 == 'B')) { return 'B'; } else if ((c1 == 'A' && c2 == 'B') || (c1 == 'B' && c2 == 'A')) { return 'C'; //AB } else { return 'O'; } } int main() { string s, t; cin >> s >> t; double a = 0, b = 0, ab = 0, o = 0; for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { if (findnw(s.at(i), t.at(j)) == 'A') a++; else if (findnw(s.at(i), t.at(j)) == 'B') b++; else if (findnw(s.at(i), t.at(j)) == 'C') ab++; else o++; } } cout << a / 4 * 100 << ' ' << b / 4 * 100 << ' '; cout << ab / 4 * 100 << ' ' << o / 4 * 100 << endl; }