#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int color[110], no[4] = {0};
  cin >> s;
  int n = s.length();
  for (int i = 0; i < n; i++) {
    if (s[i] == '!')
      no[i % 4]++;
    else {
      int val = s[i];
      color[val] = i % 4;
    }
  }
  cout << no[color['R']] << " " << no[color['B']] << " " << no[color['Y']]
       << " " << no[color['G']] << "\n";
}
