#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const int mod = 1000000007;
const int inf = 50000000;
const int maxn = 100010;
string second;
int n, Map[maxn];
vector<int> perm;
vector<int> ans;
int check() {
  ans.assign(4, 0);
  for (int i = 0; i < n; i++) {
    if (second[i] == '!') {
      ans[perm[i % 4]] += 1;
      continue;
    }
    if (Map[(int)second[i]] != perm[i % 4]) {
      return 0;
    }
  }
  return 1;
}
int main() {
  Map[(int)'R'] = 0;
  Map[(int)'B'] = 1;
  Map[(int)'Y'] = 2;
  Map[(int)'G'] = 3;
  ios_base::sync_with_stdio(false);
  ;
  cin.tie(NULL);
  cin >> second;
  n = second.size();
  for (int i = 0; i < 4; i++) {
    perm.push_back(i);
  }
  while (1) {
    if (check()) {
      break;
    }
    if (!next_permutation(perm.begin(), perm.end())) {
      break;
    }
  }
  for (int i = 0; i < 4; i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
