#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, x = 0, a[4];
  string s;
  map<char, long long> m4;
  cin >> s;
  for (i = 0; i < s.length(); i++) {
    if (s[i] != '!') a[i % 4] = s[i];
  }
  for (i = 0; i < s.length(); i++) {
    if (s[i] == '!') {
      s[i] = a[i % 4];
      m4[s[i]]++;
    }
  }
  cout << m4['R'] << " " << m4['B'] << " " << m4['Y'] << " " << m4['G'];
  return 0;
}
