#include <bits/stdc++.h>
using namespace std;
const int oo = int(2e9) + 9;
const double eps = 1e-9;
const double pi = 3.14159265358979323846264338327950;
int main() {
  string str;
  cin >> str;
  char X[5];
  int cnt[200];
  cnt['R'] = 0, cnt['G'] = 0, cnt['B'] = 0, cnt['Y'] = 0;
  for (int i = 0; i < str.size(); i++) {
    if (str[i] == 'R') X[i % 4] = 'R';
    if (str[i] == 'B') X[i % 4] = 'B';
    if (str[i] == 'Y') X[i % 4] = 'Y';
    if (str[i] == 'G') X[i % 4] = 'G';
  }
  for (int i = 0; i < str.size(); i++) {
    if (str[i] == '!') {
      str[i] = X[i % 4];
      cnt[str[i]]++;
    }
  }
  cout << cnt['R'] << " " << cnt['B'] << " " << cnt['Y'] << " " << cnt['G']
       << endl;
  return 0;
}
