#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long t;
  t = 1;
  while (t--) {
    string s;
    cin >> s;
    long long r, b, g, y;
    vector<long long> a(4, 0);
    for (long long i = 0; i < s.size(); i++) {
      if (s[i] == 'R')
        r = i % 4;
      else if (s[i] == 'B')
        b = i % 4;
      else if (s[i] == 'G')
        g = i % 4;
      else if (s[i] == 'Y')
        y = i % 4;
      else
        a[i % 4]++;
    }
    cout << a[r] << " " << a[b] << " " << a[y] << " " << a[g] << endl;
  }
  return 0;
}
