#include <bits/stdc++.h>
using namespace std;
string s;
int check(char ch) {
  for (int i = 0; s[i] != '\0'; i++) {
    if (s[i] == ch) {
      return i;
    }
  }
}
int cnt(int it, int sz) {
  int sum = 0;
  for (int i = it + 4; i < sz; i += 4) {
    if (s[i] == '!') sum++;
  }
  if ((it - 4) >= 0) {
    for (int i = it - 4; i >= 0; i -= 4) {
      if (s[i] == '!') sum++;
    }
  }
  return sum;
}
int main() {
  cin >> s;
  int arr[10];
  int siz = s.size();
  int x = check('R');
  arr[0] = cnt(x, siz);
  x = check('B');
  arr[1] = cnt(x, siz);
  x = check('Y');
  arr[2] = cnt(x, siz);
  x = check('G');
  arr[3] = cnt(x, siz);
  for (int i = 0; i < 4; i++) {
    cout << arr[i] << " ";
  }
  cout << endl;
  return 0;
}
