#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  map<char, int> m;
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] != '!') {
      m[s[i]] = i % 4;
    }
  }
  vector<int> res(256, 0);
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == '!') {
      res[i % 4]++;
    }
  }
  cout << res[m['R']] << ' ';
  cout << res[m['B']] << ' ';
  cout << res[m['Y']] << ' ';
  cout << res[m['G']] << '\n';
  return 0;
}
