#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
	string s,t;
	cin >> s >> t;
	vector<int> c(4,0);
	for(int i = 0; i < 2; i++) for(int j = 0; j < 2; j++) {
		vector<int> x(3,0);
		if(s[i] == 'A') x[0]++;
		else if(s[i] == 'B') x[1]++;
		else x[2]++;
		if(t[j] == 'A') x[0]++;
		else if(t[j] == 'B') x[1]++;
		else x[2]++;
		if(x[0] > 0 && x[1] == 0) c[0]++;
		else if(x[0] == 0 && x[1] > 0) c[1]++;
		else if(x[0] > 0 && x[1] > 0) c[2]++;
		else c[3]++;
	}
	for(int i = 0; i < 4; i++) cout << c[i]*25 << ' ';
	cout << endl;
}