#include <bits/stdc++.h>
using namespace std;
int a[105], n, ans[4], vis[4];
char str[105];
char temp[205];
void Solve() {
  temp['R'] = 0, temp['B'] = 1, temp['Y'] = 2, temp['G'] = 3, temp['!'] = -1;
  while (~scanf(" %s", str)) {
    n = strlen(str);
    memset(ans, 0, sizeof(ans));
    memset(vis, 0, sizeof(vis));
    for (int i = 0; i < n; i++) a[i + 1] = temp[str[i]];
    while (true) {
      int flag = 0;
      for (int i = 1; i <= n; i++)
        if (a[i] == -1) flag = 1;
      if (!flag) break;
      for (int i = 1; i <= n; i++) {
        if (a[i] == -1) continue;
        if (vis[a[i]]) continue;
        vis[a[i]] = 1;
        for (int j = i; j <= n; j += 4)
          if (a[j] == -1) a[j] = a[i], ans[a[i]]++;
        for (int j = i; j >= 1; j -= 4)
          if (a[j] == -1) a[j] = a[i], ans[a[i]]++;
      }
    }
    for (int i = 0; i < 4; i++) printf("%d%c", ans[i], i == 3 ? '\n' : ' ');
  }
}
int main() {
  Solve();
  return 0;
}
