#include <bits/stdc++.h>
using namespace std;
char sir[114];
char s[10];
char stnew[114];
int main() {
  ios ::sync_with_stdio(false);
  int l;
  cin >> (sir + 1);
  l = strlen(sir + 1);
  s[1] = 'Y';
  s[2] = 'G';
  s[3] = 'R';
  s[4] = 'B';
  map<char, int> H;
  int bul = 10000;
  while (bul--) {
    random_shuffle(s + 1, s + 5);
    bool ok = true;
    for (int i = 1; i <= 4; ++i) {
      if (sir[i] == '!') {
        continue;
      }
      if (s[i] != sir[i]) {
        ok = false;
        break;
      }
    }
    if (ok == false) {
      continue;
    }
    int cate = 0;
    int times = l / 4 + 1;
    for (int i = 1; i <= times; ++i) {
      stnew[4 * i - 3] = s[1];
      stnew[4 * i - 2] = s[2];
      stnew[4 * i - 1] = s[3];
      stnew[4 * i] = s[4];
    }
    H.clear();
    for (int i = 1; i <= l; ++i) {
      if (sir[i] == '!') {
        H[stnew[i]] += 1;
      } else if (sir[i] != stnew[i]) {
        ok = false;
        break;
      }
    }
    if (ok == false) {
      continue;
    }
    cout << H['R'] << ' ' << H['B'] << ' ' << H['Y'] << ' ' << H['G'];
    return 0;
  }
  return 0;
}
