#include <bits/stdc++.h>
int main() {
  std::ios_base::sync_with_stdio(false);
  std::string s;
  std::getline(std::cin, s);
  const char l[] = "RBYG";
  int cnt[] = {0, 0, 0, 0};
  for (int i = 0; i != 4; ++i) {
    int j = 0;
    for (; j != (int)s.size(); ++j)
      if (s[j] == l[i]) break;
    for (int k = j + 4; k < (int)s.size(); k += 4) {
      if (s[k] == '!') ++cnt[i];
    }
    for (int k = j - 4; k >= 0; k -= 4) {
      if (s[k] == '!') ++cnt[i];
    }
  }
  std::cout << cnt[0] << " " << cnt[1] << " " << cnt[2] << " " << cnt[3]
            << "\n";
  return 0;
}
