#include <bits/stdc++.h>
using namespace std;
char ss[1000];
int main() {
  int a, b, c, d;
  string s;
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'R') a = i;
    if (s[i] == 'G') b = i;
    if (s[i] == 'B') c = i;
    if (s[i] == 'Y') d = i;
  }
  for (int i = a; i >= 0; i -= 4) ss[i] = 'R';
  for (int i = a; i < s.length(); i += 4) ss[i] = 'R';
  for (int i = b; i >= 0; i -= 4) ss[i] = 'G';
  for (int i = b; i < s.length(); i += 4) ss[i] = 'G';
  for (int i = c; i >= 0; i -= 4) ss[i] = 'B';
  for (int i = c; i < s.length(); i += 4) ss[i] = 'B';
  for (int i = d; i >= 0; i -= 4) ss[i] = 'Y';
  for (int i = d; i < s.length(); i += 4) ss[i] = 'Y';
  int p, q, r, t;
  p = q = r = t = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '!') {
      if (ss[i] == 'R') p++;
      if (ss[i] == 'B') q++;
      if (ss[i] == 'Y') r++;
      if (ss[i] == 'G') t++;
    }
  }
  printf("%d %d %d %d", p, q, r, t);
  return 0;
}
