#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
void solve(string &str)
{
int begin = 0;
int current = 0;
int end = str.length()-1;
while(current <= end)
{
if(str[current] == 'R')
{
swap(str[current], str[begin]);
++current;
++begin;
}
else if(str[current] == 'G')
{
++current;
}
else if(str[current] == 'B')
{
swap(str[current], str[end]);
--end; // 这里current不++,是为了检验从后面交换过来的那个元素
}
cout << begin << " " << current << " " << end << endl;
cout << str << endl;
}
}
int main()
{
string str;
cin >> str;
solve(str);
cout << str;
return 0;
}