#include <bits/stdc++.h>
int main() {
  std::ios::sync_with_stdio(0);
  std::cin.tie(0);
  std::string st;
  std::cin >> st;
  std::map<char, int> mp;
  char c[4]{};
  for (int i = 0; i < 4; ++i)
    for (int j = i; j < st.size(); j += 4)
      if (st[j] != '!') c[i] = st[j];
  for (int i = 0; i < st.size(); ++i) {
    if (st[i] != c[i % 4]) ++mp[c[i % 4]];
  }
  std::cout << mp['R'] << " " << mp['B'] << " " << mp['Y'] << " " << mp['G'];
}
