#include <bits/stdc++.h>
using namespace std;
inline char nc() { getchar(); }
inline void read(int &x) {
  char c = nc(), b = 1;
  for (; !(c >= '0' && c <= '9'); c = nc())
    if (c == '-') b = -1;
  for (x = 0; c >= '0' && c <= '9'; x = x * 10 + c - '0', c = nc())
    ;
  x *= b;
}
inline void read(long long &x) {
  char c = nc(), b = 1;
  for (; !(c >= '0' && c <= '9'); c = nc())
    if (c == '-') b = -1;
  for (x = 0; c >= '0' && c <= '9'; x = x * 10 + c - '0', c = nc())
    ;
  x *= b;
}
int wt, ss[19];
inline void print(int x) {
  if (x < 0) x = -x, putchar('-');
  if (!x)
    putchar(48);
  else {
    for (wt = 0; x; ss[++wt] = x % 10, x /= 10)
      ;
    for (; wt; putchar(ss[wt] + 48), wt--)
      ;
  }
}
inline void print(long long x) {
  if (x < 0) x = -x, putchar('-');
  if (!x)
    putchar(48);
  else {
    for (wt = 0; x; ss[++wt] = x % 10, x /= 10)
      ;
    for (; wt; putchar(ss[wt] + 48), wt--)
      ;
  }
}
char s[200];
int n, m, r, b, y, g;
int main() {
  cin >> s;
  n = strlen(s);
  r = 0;
  while (s[r] != 'R') r++;
  r %= 4;
  b = 0;
  while (s[b] != 'B') b++;
  b %= 4;
  y = 0;
  while (s[y] != 'Y') y++;
  y %= 4;
  g = 0;
  while (s[g] != 'G') g++;
  g %= 4;
  int ansr = 0, ansg = 0, ansb = 0, ansy = 0;
  for (int i = 0; i < n; i++)
    if (s[i] == '!' && i % 4 == r)
      ansr++;
    else if (s[i] == '!' && i % 4 == b)
      ansb++;
    else if (s[i] == '!' && i % 4 == y)
      ansy++;
    else if (s[i] == '!' && i % 4 == g)
      ansg++;
  printf("%d %d %d %d\n", ansr, ansb, ansy, ansg);
  return 0;
}
