#include <bits/stdc++.h>
using namespace std;
long long int ar[1000006];
int main() {
  long long int i, j, k, n, m, ans = 0;
  map<char, int> ma;
  string s;
  cin >> s;
  m = s.size();
  for (i = 0; i < m; i++) {
    if (s[i] == '!')
      ar[i % 4]++;
    else {
      ma[s[i]] = i % 4;
    }
  }
  cout << ar[ma['R']] << " " << ar[ma['B']] << " " << ar[ma['Y']] << " "
       << ar[ma['G']];
  return 0;
}
