#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.length();
  int ans[4] = {};
  int c[301] = {};
  for (int i = 0; i < n; i++) {
    if (s[i] == '!')
      ans[i % 4]++;
    else
      c[s[i]] = i % 4;
  }
  cout << ans[c['R']] << " " << ans[c['B']] << " " << ans[c['Y']] << " "
       << ans[c['G']];
}
