#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int r = 0, b = 0, y = 0, g = 0;
  char ans;
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] != '!') {
      ans = s[i];
      for (int j = i + 4; j < s.length(); j += 4) {
        if (s[j] == '!') {
          switch (ans) {
            case 'R':
              r++;
              break;
            case 'G':
              g++;
              break;
            case 'B':
              b++;
              break;
            case 'Y':
              y++;
              break;
          }
          s[j] = ans;
        }
      }
    } else {
      for (int j = i + 4; j < s.length(); j += 4) {
        if (s[j] != '!') {
          ans = s[j];
          break;
        }
      }
      for (int j = i; j < s.length(); j += 4) {
        if (s[j] == '!') {
          switch (ans) {
            case 'R':
              r++;
              break;
            case 'G':
              g++;
              break;
            case 'B':
              b++;
              break;
            case 'Y':
              y++;
              break;
          }
          s[j] = ans;
        }
      }
    }
  }
  cout << r << " " << b << " " << y << " " << g;
}
