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