#include <bits/stdc++.h>
using namespace std;
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
static const double EPS = 1e-5;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)

int main(void){
  string line[3];
  while(cin>>line[0]>>line[1]>>line[2]){
    REP(i,3){
      int a=0,b=0;
      FOR(j,1,line[i].size()){
        if(line[i][j]=='A') a++;
        else b++;
      }
      if(a-b>0) a++;
      else b++;
      cout<<a<<" "<<b<<endl;
    }
  }
  return 0;
}
