#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  int r = -1, g = -1, b = -1, y = -1;
  int rc = 0, gc = 0, yc = 0, bc = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'R' && r == -1) r = i % 4;
    if (s[i] == 'Y' && y == -1) y = i % 4;
    if (s[i] == 'G' && g == -1) g = i % 4;
    if (s[i] == 'B' && b == -1) b = i % 4;
  }
  for (int i = r; i < s.size(); i += 4)
    if (s[i] != 'R') rc++;
  for (int i = b; i < s.size(); i += 4)
    if (s[i] != 'B') bc++;
  for (int i = g; i < s.size(); i += 4)
    if (s[i] != 'G') gc++;
  for (int i = y; i < s.size(); i += 4)
    if (s[i] != 'Y') yc++;
  cout << rc << " " << bc << " " << yc << " " << gc << endl;
  return 0;
}
