#include <bits/stdc++.h>
using namespace std;
char s[] = "RBYG";
int main() {
  string str;
  cin >> str;
  int n = str.length();
  sort(s, s + 4);
  do {
    bool flag = true;
    for (int i = 0; i < n; i++) {
      if (str[i] != '!' && str[i] != s[i % 4]) {
        flag = false;
        break;
      }
    }
    if (flag) break;
  } while (next_permutation(s, s + 4));
  map<char, int> mp;
  for (int i = 0; i < n; i++) {
    if (str[i] == '!') mp[s[i % 4]]++;
  }
  cout << mp['R'] << " " << mp['B'] << " " << mp['Y'] << " " << mp['G'] << endl;
  return 0;
}
