#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n;
  char len[105];
  int a[105] = {0}, b[105] = {0};
  scanf("%s", len);
  n = strlen(len);
  for (i = 0; i < n; i++) {
    if (len[i] == '!')
      a[i % 4]++;
    else {
      b[len[i]] = i % 4;
    }
  }
  printf("%d %d %d %d\n", a[b['R']], a[b['B']], a[b['Y']], a[b['G']]);
}
