#include <bits/stdc++.h>
const int NMAX = 100;
const int CMAX = 4;
char v[NMAX + 1];
char sol[CMAX + 1];
char aux[CMAX + 1];
int main() {
  int n = 0;
  while (!feof(stdin)) {
    scanf("%c ", &v[++n]);
  }
  for (int i = 1; i <= 4; i++) {
    sol[i] = '!';
  }
  int red, green, blue, yellow;
  red = green = blue = yellow = 0;
  int e = 0, verif = 0, pp = 0;
  for (int i = 1; i <= n && pp == 0; i++) {
    aux[++e] = v[i];
    if (i % 4 == 0) {
      for (int j = 1; j <= 4; j++) {
        if (sol[j] == '!' && aux[j] != '!') {
          sol[j] = aux[j];
          verif++;
        }
      }
      e = 0;
      if (verif == 4) pp = 1;
    }
  }
  if (n % 4 != 0) {
    for (int j = 1; j <= e; j++) {
      if (sol[j] == '!' && aux[j] != '!') {
        sol[j] = aux[j];
        verif++;
      }
    }
  }
  if (verif == 4) {
    int e = 0;
    for (int i = 1; i <= n; i++) {
      aux[++e] = v[i];
      if (i % 4 == 0) {
        for (int j = 1; j <= 4; j++) {
          if (aux[j] == '!') {
            if (sol[j] == 'R') red++;
            if (sol[j] == 'B') blue++;
            if (sol[j] == 'Y') yellow++;
            if (sol[j] == 'G') green++;
          }
        }
        e = 0;
      }
    }
    if (n % 4 != 0) {
      for (int j = 1; j <= e; j++) {
        if (aux[j] == '!') {
          if (sol[j] == 'R') red++;
          if (sol[j] == 'B') blue++;
          if (sol[j] == 'Y') yellow++;
          if (sol[j] == 'G') green++;
        }
      }
    }
  }
  printf("%d %d %d %d\n", red, blue, yellow, green);
  return 0;
}
