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