#include <bits/stdc++.h>
using namespace std;
void In() { freopen("in.in", "r", stdin); }
void Out() { freopen("out.out", "w", stdout); }
const int N = 1e5 + 10;
const int M = 3e5 + 10;
const int Mbit = 1e6 + 10;
const int inf = 0x3f3f3f3f;
const long long mod = 1e9 + 7;
int f(char s) {
  if (s == 'R') return 0;
  if (s == 'B') return 1;
  if (s == 'Y') return 2;
  return 3;
}
int b[4];
char s[N];
int main() {
  cin >> s;
  int n = strlen(s);
  int a[4] = {-1, -1, -1, -1};
  for (int i = 0; i < n; i++) {
    if (s[i] == '!') continue;
    int x = f(s[i]);
    a[x] = i % 4;
  }
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++)
      if (a[j] == -1) {
        a[j] = i;
        break;
      }
  for (int i = 0; i < n; i++) {
    if (s[i] != '!') continue;
    for (int j = 0; j < 4; j++)
      if (a[j] == (i % 4)) b[j]++;
  }
  printf("%d %d %d %d\n", b[0], b[1], b[2], b[3]);
  return 0;
}
