#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int size = s.length();
  int i;
  int sr, sb, sg, sy;
  for (i = size - 1; i >= 0; i--) {
    if (s[i] == 'R') {
      sr = i;
    } else if (s[i] == 'B') {
      sb = i;
    } else if (s[i] == 'G') {
      sg = i;
    } else if (s[i] == 'Y') {
      sy = i;
    }
  }
  while (sr >= 0) {
    sr = sr - 4;
  }
  sr = sr + 4;
  while (sb >= 0) {
    sb = sb - 4;
  }
  sb = sb + 4;
  while (sg >= 0) {
    sg = sg - 4;
  }
  sg = sg + 4;
  while (sy >= 0) {
    sy = sy - 4;
  }
  sy = sy + 4;
  long long ar = 0, ab = 0, ag = 0, ay = 0;
  while (sr < size) {
    if (s[sr] == '!') {
      ar++;
    }
    sr = sr + 4;
  }
  while (sb < size) {
    if (s[sb] == '!') {
      ab++;
    }
    sb = sb + 4;
  }
  while (sg < size) {
    if (s[sg] == '!') {
      ag++;
    }
    sg = sg + 4;
  }
  while (sy < size) {
    if (s[sy] == '!') {
      ay++;
    }
    sy = sy + 4;
  }
  cout << ar << " " << ab << " " << ay << " " << ag;
  return 0;
}
