#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <string>
using namespace std;
char a[1006];
int main()
{
while(~scanf("%s",a))
{
int k=strlen(a);
int r,g,b,y;
int c[10005];
int cnt=0;
for(int i=0; i<k; i++)
{
if(a[i]=='!')
{
c[cnt++]=i;
}
else if(a[i]=='R')
{
r=i;
}
else if(a[i]=='G')
{
g=i;
}
else if(a[i]=='B')
{
b=i;
}
else if(a[i]=='Y')
{
y=i;
}
}
r%=4;
g%=4;
b%=4;
y%=4;
int R=0,G=0,B=0,Y=0;
for(int i=0;i<cnt;i++)
{
if(c[i]%4==r)
R++;
else if(c[i]%4==g)
G++;
else if(c[i]%4==b)
B++;
else if(c[i]%4==y)
Y++;
}
printf("%d %d %d %d\n",R,B,Y,G);
}
return 0;
}