#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  string S;
  cin >> S;
  int n = S.length();
  char c[4];
  for (int i = 0; i < n; ++i) {
    if (S[i] != '!') {
      c[i % 4] = S[i];
    }
  }
  map<char, int> M;
  M['R'] = 0;
  M['B'] = 0;
  M['Y'] = 0;
  M['G'] = 0;
  for (int i = 0; i < n; ++i) {
    if (S[i] == '!') M[c[i % 4]]++;
  }
  cout << M['R'] << " " << M['B'] << " " << M['Y'] << " " << M['G'] << "\n";
  return 0;
}
