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