#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  char s[1000];
  cin >> s;
  int n = strlen(s);
  char ss[5] = "RBYG";
  char arr[4];
  int num[4];
  int alph[500];
  for (int i = 0; i < 500; i++) alph[i] = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] != '!') {
      arr[i % 4] = s[i];
    }
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '!') {
      alph[arr[i % 4]]++;
    }
  }
  for (int i = 0; i < 4; i++) {
    cout << alph[ss[i]] << " ";
  }
}
