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