#include <bits/stdc++.h>
using namespace std;
long long ans[100005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t, n, m, x, y, a, b, c, d;
  string s;
  cin >> s;
  long long sz = s.size() - 1;
  for (long long int i = (0); i <= (sz); ++i) {
    if (s[i] == 'R')
      a = i % 4;
    else if (s[i] == 'B')
      b = i % 4;
    else if (s[i] == 'Y')
      c = i % 4;
    else if (s[i] == 'G')
      d = i % 4;
    else
      ans[i % 4]++;
  }
  cout << ans[a] << " " << ans[b] << " " << ans[c] << " " << ans[d] << endl;
  return 0;
}
