#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  int n = s.length();
  char col[4] = {'R', 'B', 'Y', 'G'};
  int ans[4];
  for (int i = 0; i < 4; ++i) {
    int wh = -1;
    for (int j = 0; j < n; ++j) {
      if (s[j] == col[i]) wh = j;
    }
    ans[i] = 0;
    for (int j = 0; j < n; ++j) {
      if (j % 4 == wh % 4 && s[j] == '!') ++ans[i];
    }
    cout << ans[i] << " ";
  }
  cout << "\n";
}
int main() {
  int k = 1;
  for (; k <= 1; ++k) {
    solve();
  }
}
