#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.length();
  int i, a[200] = {0};
  for (i = 0; i < n; i++) {
    if (s[i] == '!') {
      a[i] = 1;
    }
  }
  for (i = 0; i < n; i++) {
    if (s[i] != '!') {
      int j = i, k = i;
      while (j + 4 < n) {
        s[j + 4] = s[j];
        j += 4;
      }
      while (k - 4 >= 0) {
        s[k - 4] = s[k];
        k -= 4;
      }
    }
  }
  int R = 0, Y = 0, B = 0, G = 0;
  for (i = 0; i < n; i++) {
    if (a[i] == 1) {
      if (s[i] == 'R') {
        R++;
      } else if (s[i] == 'G') {
        G++;
      } else if (s[i] == 'B') {
        B++;
      } else if (s[i] == 'Y') {
        Y++;
      }
    }
  }
  cout << R << " " << B << " " << Y << " " << G << endl;
  return 0;
}
