#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int count[4];
  count[0] = 0;
  count[1] = 0;
  count[2] = 0;
  count[3] = 0;
  int position[4] = {0, 0, 0, 0};
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'R') position[0] = i % 4;
    if (s[i] == 'B') position[1] = i % 4;
    if (s[i] == 'Y') position[2] = i % 4;
    if (s[i] == 'G') position[3] = i % 4;
  }
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '!') {
      if (i % 4 == position[0]) count[0]++;
      if (i % 4 == position[1]) count[1]++;
      if (i % 4 == position[2]) count[2]++;
      if (i % 4 == position[3]) count[3]++;
    }
  }
  cout << count[0] << " " << count[1] << " " << count[2] << " " << count[3]
       << endl;
  return 0;
}
