#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  char c[4];
  int A[100] = {0}, r, b, y, g, j = 0;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (j > 3) break;
    int ok = 1;
    for (int k = 0; k < 4; k++)
      if (c[k] == s[i]) ok = 0;
    if (s[i] != '!' && ok) {
      c[i % 4] = s[i];
      j++;
    }
  }
  for (int i = 0; i < s.size(); i++)
    if (s[i] == '!') A[i % 4]++;
  for (int i = 0; i < 4; i++) {
    if (c[i] == 'R') r = A[i];
    if (c[i] == 'B') b = A[i];
    if (c[i] == 'G') g = A[i];
    if (c[i] == 'Y') y = A[i];
  }
  cout << r << " " << b << " " << y << " " << g;
  return 0;
}
