#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int r = 0, b = 0, y = 0, g = 0;
  int len = s.size();
  for (int i = 0; i < len; i++) {
    if (s[i] == 'B')
      b = i % 4;
    else if (s[i] == 'G')
      g = i % 4;
    else if (s[i] == 'R')
      r = i % 4;
    else if (s[i] == 'Y')
      y = i % 4;
  }
  int w = 0, x = 0, yy = 0, z = 0, pos;
  for (int i = 0; i < len; i++) {
    if (s[i] == '!') {
      pos = i % 4;
      if (pos == r)
        w++;
      else if (pos == b)
        x++;
      else if (pos == y)
        yy++;
      else if (pos == g)
        z++;
    }
  }
  cout << w << " " << x << " " << yy << " " << z << endl;
  return 0;
}
