#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int mod = 1e9 + 7;
char s[105];
int r = 0, b = 0, y = 0, g = 0;
char f[4];
int main() {
  scanf("%s", s);
  int len = strlen(s);
  if (len == 4) {
    for (int i = 0; i < 4; i++) {
      if (s[i] == 'R')
        r++;
      else if (s[i] == 'Y')
        y++;
      else if (s[i] == 'B')
        b++;
      else if (s[i] == 'G')
        g++;
    }
    printf("%d %d %d %d\n", 1 - r, 1 - b, 1 - y, 1 - g);
  } else {
    for (int i = 0; i < 4; i++) {
      for (int j = i; j < len; j += 4) {
        if (s[j] == 'R') {
          f[j % 4] = 'R';
        } else if (s[j] == 'Y') {
          f[j % 4] = 'Y';
        } else if (s[j] == 'B') {
          f[j % 4] = 'B';
        } else if (s[j] == 'G') {
          f[j % 4] = 'G';
        }
      }
    }
    for (int i = 0; i < len; i++) {
      if (s[i] == '!') {
        if (f[i % 4] == 'R')
          r++;
        else if (f[i % 4] == 'Y')
          y++;
        else if (f[i % 4] == 'B')
          b++;
        else if (f[i % 4] == 'G')
          g++;
      }
    }
    printf("%d %d %d %d\n", r, b, y, g);
  }
  return 0;
}
