#include <bits/stdc++.h>
using namespace std;
char str[105];
int cnt[4] = {0};
int k[4];
int main() {
  scanf("%s", str);
  int len = strlen(str);
  int start = -1;
  memset(k, -1, sizeof k);
  for (int t = 0; t < 4; ++t) {
    start = t;
    for (int i = start; i < len; i += 4) {
      if (str[i] == '!') {
        cnt[t]++;
      } else if (str[i] == 'R') {
        k[t] = 0;
      } else if (str[i] == 'B') {
        k[t] = 1;
      } else if (str[i] == 'Y') {
        k[t] = 2;
      } else if (str[i] == 'G') {
        k[t] = 3;
      }
    }
  }
  int kr = 0, kb = 0, ky = 0, kg = 0;
  for (int i = 0; i < 4; ++i) {
    if (k[i] == 0) {
      kr = cnt[i];
    } else if (k[i] == 1) {
      kb = cnt[i];
    } else if (k[i] == 2) {
      ky = cnt[i];
    } else if (k[i] == 3) {
      kg = cnt[i];
    }
  }
  printf("%d %d %d %d\n", kr, kb, ky, kg);
  return 0;
}
