#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  char vis[105], a;
  map<char, int> mp;
  int m = 0;
  for (int i = 0; i < s.size(); i++) {
    int x = i;
    while (x < s.size() && s[x] == '!') {
      x += 4;
    }
    if (x >= s.size()) {
      ;
    } else {
      a = s[x];
      x = i;
      while (x < s.size()) {
        if (s[x] == '!') mp[a]++;
        s[x] = a;
        x += 4;
      }
    }
  }
  printf("%d %d %d %d\n", mp['R'], mp['B'], mp['Y'], mp['G']);
}
