#include <bits/stdc++.h>
using namespace std;

#define for_(i,a,b) for(int i=(a);i<(b);++i)

int p[3][2];
string game[3];

void poyo() {
	memset(p, 0, sizeof(p));
	
	for_(i,0,3) {
		if (i != 0) ++p[i - 1][game[i][0] - 'A'];
		int len = game[i].size();	
		for_(j,1,len) ++p[i][game[i][j] - 'A'];
	}
	
	for_(i,0,3) {
		cout << p[i][0] + (i == 2 ? p[i][0] > p[i][1] : 0) << " " << p[i][1] + (i == 2 ? p[i][0] < p[i][1] : 0) << endl;
	}
}

int main() {
	while (cin >> game[0] >> game[1] >> game[2]) poyo();
}