#include <bits/stdc++.h>
using namespace std;
string s, correct;
int n, numOn[100], total[100];
int c[] = {'R', 'B', 'Y', 'G'};
void setup() {
  cin >> s;
  correct = s;
  n = s.size();
  for (int i = 0; i <= n - 1; i++)
    if (s[i] != '!') {
      if (++numOn[s[i]] > 1) continue;
      for (int t = i; t < n; t += 4) correct[t] = s[i];
      for (int t = i; t >= 0; t -= 4) correct[t] = s[i];
    }
  for (int i = 0; i <= n - 1; i++) total[correct[i]]++;
  for (int i = 0; i <= 3; i++) cout << total[c[i]] - numOn[c[i]] << ' ';
}
void xuly() {}
int main() {
  iostream::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  setup();
  xuly();
  return 0;
}
