#include <bits/stdc++.h>
using namespace std;
string s;
int n;
char mods[4];
int cnts[4];
int ans[4];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  n = s.size();
  for (int i = 0; i < n; i++) {
    if (s[i] == '!') {
      cnts[(i % 4)]++;
    } else {
      mods[(i % 4)] = s[i];
    }
  }
  for (int i = 0; i < 4; i++) {
    if (mods[i] == 'R')
      ans[0] = cnts[i];
    else if (mods[i] == 'B')
      ans[1] = cnts[i];
    else if (mods[i] == 'Y')
      ans[2] = cnts[i];
    else
      ans[3] = cnts[i];
  }
  for (int i = 0; i < 4; i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}
