#include <bits/stdc++.h>
using namespace std;
long long t[5], a[111111], ans[5];
string s;
int main() {
  cin >> s;
  for (long long j = 0; j < 4; ++j) {
    for (long long i = j; i < s.size(); i += 4) {
      if (s[i] != '!') {
        t[i % 4] = s[i];
        break;
      }
    }
  }
  for (long long i = 0; i < s.size(); ++i) {
    if (s[i] == '!') a[t[i % 4]]++;
  }
  for (long long i = 0; i < 4; ++i) {
    if (t[i] == 'R') {
      ans[1] = a[t[i]];
    }
    if (t[i] == 'B') {
      ans[2] = a[t[i]];
    }
    if (t[i] == 'Y') {
      ans[3] = a[t[i]];
    }
    if (t[i] == 'G') {
      ans[4] = a[t[i]];
    }
  }
  cout << ans[1] << " " << ans[2] << " " << ans[3] << " " << ans[4];
}
