#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int kr, kb, ky, kg, fr, fb, fy, fg;
  kr = kb = ky = kg = fr = fb = fy = fg = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'G' && !fg)
      for (int j = i % 4; j < s.size(); j += 4)
        if (s[j] != s[i]) kg++, fg = 1;
    if (s[i] == 'Y' && !fy)
      for (int j = i % 4; j < s.size(); j += 4)
        if (s[j] != 'Y') ky++, fy = 1;
    if (s[i] == 'B' && !fb)
      for (int j = i % 4; j < s.size(); j += 4)
        if (s[j] != s[i]) kb++, fb = 1;
    if (s[i] == 'R' && !fr)
      for (int j = i % 4; j < s.size(); j += 4)
        if (s[j] != s[i]) kr++, fr = 1;
  }
  cout << kr << ' ' << kb << ' ' << ky << ' ' << kg;
}
