#include <bits/stdc++.h>
using namespace std;
string s;
int i, j, k;
int l, Rindex, Bindex, Yindex, Gindex;
int Rcnt, Bcnt, Ycnt, Gcnt;
int main() {
  cin >> s;
  l = s.length();
  for (i = 0; i < l; i++) {
    if (s[i] == 'R') Rindex = i % 4;
    if (s[i] == 'B') Bindex = i % 4;
    if (s[i] == 'Y') Yindex = i % 4;
    if (s[i] == 'G') Gindex = i % 4;
  }
  for (i = 0; i < l; i++) {
    if (i % 4 == Rindex && s[i] == '!')
      Rcnt++;
    else if (i % 4 == Bindex && s[i] == '!')
      Bcnt++;
    else if (i % 4 == Yindex && s[i] == '!')
      Ycnt++;
    else if (i % 4 == Gindex && s[i] == '!')
      Gcnt++;
  }
  cout << Rcnt << " " << Bcnt << " " << Ycnt << " " << Gcnt;
  return 0;
}
