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