#include #include using namespace std; using ll = long long; int main(){ string s, t; cin >> s >> t; vector cnt(4); for (char i: s){ for (char j: t){ char k = i, l = j; if (k > l) swap(k, l); if (k == 'A' && l == 'B') cnt[2]++; else if (k == 'A') cnt[0]++; else if (k == 'B') cnt[1]++; else cnt[3]++; } } cout << cnt[0] * 100 / 4 << " " << cnt[1] * 100 / 4 << " " << cnt[2] * 100 / 4 << " " << cnt[3] * 100 / 4 << endl; }