#include //#include using namespace std; //using namespace atcoder; using ll = long long; const ll mod = 1000000007; //const ll mod = 998244353; int dx[4] = { 0,1,0,-1 }, dy[4] = { -1,0,1,0 }; string s, t; ll ans[4]; int main() { cin >> s >> t; for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { if (s[i] == 'A' && t[j] != 'B')ans[0] += 25LL; else if (t[j] == 'A' && s[i] != 'B')ans[0] += 25LL; else if (s[i] == 'B' && t[j] != 'A')ans[1] += 25LL; else if (t[j] == 'B' && s[i] != 'A')ans[1] += 25LL; else if (s[i] == 'A' && t[j] == 'B')ans[2] += 25LL; else if (s[i] == 'B' && t[j] == 'A')ans[2] += 25LL; else ans[3] += 25LL; } } cout << ans[0] << " " << ans[1] << " " << ans[2] << " " << ans[3] << endl; }