#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main()
{
	string s[3];
	int A[3], B[3], i, j;
	bool f;
	while (1)
	{
		for (i = f = 0; i < 3; i++)
		{
			cin >> s[i];
			if (s[i] == "0")
			{
				f = true;
				break;
			}
		}
		if (f) break;

		for (i = 0; i < 3; i++)
		{
			A[i] = B[i] = 0;
			for (j = 1; j < s[i].length(); j++)
			{
				if (s[i][j] == 'A')
					A[i]++;
				else
					B[i]++;
			}
			if (i < 2 && s[i+1][0] == 'A')
				A[i]++;
			else
				B[i]++;
		}
		if (A[2] >= 10 && B[2] >= 10)
		{
			if (A[2] - B[2] == 1)
				A[2]++;
			else if (B[2] - A[2] == 1)
				B[2]++;
		}
		else if (A[2] == 10)
			A[2]++, B[2]--;
		else if (B[2] == 10)
			B[2]++, A[2]--;
		cout << A[0] << " " << B[0] << endl;
		cout << A[1] << " " << B[1] << endl;
		cout << A[2] << " " << B[2] << endl;
	}
	return 0;
}