#include <bits/stdc++.h>
const int INF = 0x3f3f3f3f;
const int maxn = 3e5 + 50;
const int Mod = 1000000007;
const double PI = acos(-1);
using namespace std;
int n;
char pos[256];
char buf[maxn];
int ans[4];
int main() {
  while (~scanf("%s", buf)) {
    int len = strlen(buf);
    memset(ans, 0, sizeof(ans));
    for (int i = 0; i < len; i++) {
      if (buf[i] != '!') {
        pos[buf[i]] = i % 4;
      }
    }
    for (int i = 0; i < len; i++) {
      if (buf[i] == '!') {
        ans[i % 4]++;
      }
    }
    printf("%d %d %d %d\n", ans[pos['R']], ans[pos['B']], ans[pos['Y']],
           ans[pos['G']]);
  }
  return 0;
}
