import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;

void main()
{
	foreach (line; stdin.byLine) {
		auto str = line.chomp;
		if (str.length == 1) break;
		auto aScore = str[1..str.length].count!(a => a == 'A');
		auto bScore = str[1..str.length].count!(a => a == 'B');
		if (aScore > bScore) aScore++;
		else bScore++;
		writeln(aScore, " ", bScore);
	}
}