#include <bits/stdc++.h>
using namespace std;
void rf() {}
const int nx[8] = {2, -2, -2, 2, 1, 1, -1, -1};
const int ny[8] = {1, 1, -1, -1, 2, -2, -2, 2};
const int Nx[4] = {0, 0, -1, 1};
const int Ny[4] = {1, -1, 0, 0};
const long long LINF = (long long)5e18;
const int INF = 1e9 + 7;
const int N = 6e5 + 1;
const int MAXN = 1e6 + 50;
const double EPS = 1e-9, PI = 3.14159265359;
inline int get_int() {
  char x = getchar();
  int ret = 0;
  bool neg = 0;
  while (!('0' <= x && x <= '9')) {
    if (x == '-') neg = 1;
    x = getchar();
  }
  while ('0' <= x && x <= '9') {
    ret = ret * 10 + x - '0';
    x = getchar();
  }
  if (neg) ret *= -1;
  return ret;
}
int main() {
  srand(time(0));
  rf();
  map<int, int> cnt;
  string second, p = "RBYG";
  vector<int> v = {0, 1, 2, 3};
  cin >> second;
  do {
    int pos = 0;
    bool bad = 0;
    while (pos < int(second.size())) {
      for (int i = 0; i < min(4, int(second.size()) - pos); i++)
        if (second[i + pos] != p[v[i]] && second[i + pos] != '!') bad = 1;
      pos += 4;
    }
    if (!bad) {
      pos = 0;
      while (pos < int(second.size())) {
        for (int i = 0; i < min(4, int(second.size()) - pos); i++)
          if (second[i + pos] == '!') cnt[p[v[i]]]++;
        pos += 4;
      }
      for (auto it : p) cout << cnt[it] << ' ';
      return 0;
    }
  } while (next_permutation(v.begin(), v.end()));
  return 0;
}
