#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[105];
  int c[5];
  memset(c, 0, sizeof(c));
  int len, r, b, g, y;
  int i;
  cin >> a;
  for (i = 0; i < strlen(a); i++) {
    if (a[i] == 'R') {
      r = i % 4;
    } else if (a[i] == 'B') {
      b = i % 4;
    } else if (a[i] == 'Y') {
      y = i % 4;
    } else if (a[i] == 'G') {
      g = i % 4;
    } else {
      c[i % 4]++;
    }
  }
  printf("%d %d %d %d\n", c[r], c[b], c[y], c[g]);
  return 0;
}
