#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
int SGN(double a) { return ((a > EPS) ? (1) : ((a < -EPS) ? (-1) : (0))); }
int CMP(double a, double b) { return SGN(a - b); }
struct node {
  int x, y;
  node(int x = 0, int y = 0) : x(x), y(y) {}
};
int dir[][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
int dir8[][2] = {{-1, 0}, {1, 0},  {0, -1},  {0, 1},
                 {-1, 1}, {1, -1}, {-1, -1}, {1, 1}};
int main() {
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int r = 0, b = 0, y = 0, g = 0;
  int dead = 0;
  map<int, int> deads;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '!') {
      dead++;
      deads[i]++;
    }
  }
  if (deads.size() == s.size()) {
    r += (dead / 4);
    b += (dead / 4);
    y += (dead / 4);
    g += (dead / 4);
    dead %= 4;
    for (int i = 0; i < dead; i++) {
      if (i == 0)
        r++;
      else if (i == 1)
        b++;
      else if (i == 2)
        y++;
    }
  } else if (deads.size()) {
    map<char, int> missing;
    missing['R']++;
    missing['B']++;
    missing['Y']++;
    missing['G']++;
    char pos[] = {'0', '0', '0', '0'};
    for (int i = 0; i < s.size(); i++) {
      if (s[i] != '!') {
        pos[i % 4] = s[i];
        if (missing.count(pos[i % 4])) missing.erase(pos[i % 4]);
      }
    }
    for (auto c : missing) {
      for (int i = 0; i < s.size(); i++) {
        if (s[i] == '!' && pos[i % 4] == '0') {
          pos[i % 4] = c.first;
          missing.erase(c.first);
          break;
        }
      }
    }
    for (int i = 0; i < s.size(); i++) {
      if (deads.count(i)) {
        switch (pos[i % 4]) {
          case 'R':
            r++;
            break;
          case 'G':
            g++;
            break;
          case 'B':
            b++;
            break;
          case 'Y':
            y++;
            break;
        }
      }
    }
  }
  cout << r << " " << b << " " << y << " " << g << endl;
  return 0;
}
