#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  string s;
  cin >> s;
  map<int, char> M;
  map<char, int> N;
  vector<int> v(4, 0);
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] != '!') M[i % 4] = s[i];
  }
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == '!') ++v[i % 4];
  }
  for (int i = 0; i < 4; ++i) N[M[i]] = i;
  cout << v[N['R']] << ' ' << v[N['B']] << ' ' << v[N['Y']] << ' ' << v[N['G']]
       << endl;
}
