#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100 + 5;
char s[MAXN];
int k[4];
char judge(int c) {
  switch (c) {
    case 0:
      return 'R';
    case 1:
      return 'B';
    case 2:
      return 'Y';
    case 3:
      return 'G';
  }
}
int len;
int main() {
  scanf("%s", s + 1);
  len = strlen(s + 1);
  for (int i = 0; i < 4; i++) {
    for (int j = 1; j <= len; j++) {
      if (judge(i) == s[j]) {
        for (int m = j; m <= len; m += 4) {
          if (s[m] != judge(i)) k[i]++;
        }
        for (int m = j; m >= 1; m -= 4) {
          if (s[m] != judge(i)) k[i]++;
        }
        break;
      }
    }
  }
  for (int i = 0; i < 4; i++) {
    printf("%d ", k[i]);
  }
  printf("\n");
  return 0;
}
