#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 5;
char s[MAX], t[MAX], st[4] = {'R', 'B', 'Y', 'G'};
int ans[4], len, a[4] = {0, 1, 2, 3};
bool ok() {
  for (int i = 0; i < len - 4; i++) {
    if (t[i] != t[i + 4]) return false;
  }
  return true;
}
void solve() {
  do {
    memset(ans, 0, sizeof(ans));
    int p = 0;
    for (int i = 0; i < len; i++) {
      t[i] = st[a[p]];
      if (s[i] == '!') ans[a[p]]++;
      p++;
      p %= 4;
    }
    bool flag = true;
    for (int i = 0; i < len; i++) {
      if (s[i] != '!') {
        if (s[i] != t[i]) {
          flag = false;
          break;
        }
      }
    }
    if (ok() && flag) {
      for (int i = 0; i < 4; i++) printf("%d ", ans[i]);
      return;
    }
  } while (next_permutation(a, a + 4));
}
int main() {
  scanf("%s", s);
  len = strlen(s);
  for (int i = 0; i < len; i++) t[i] = s[i];
  if (ok()) {
    printf("0 0 0 0\n");
    return 0;
  }
  solve();
  return 0;
}
