#include <iostream>
using namespace std;

int main() {
    string data;

    while (cin >> data) {
        if (data == "0") break;
        int score[2] = {0};
        for (int i = 1, l = data.size(); i < l; i++) {
            score[data[i] == 'B']++;
        }
        score[score[0]<score[1]]++;
        cout << score[0] << " " << score[1] << endl;
    }
    return 0;
}