#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  int broke[4] = {0, 0, 0, 0};
  char color[4] = {'R', 'R', 'R', 'R'};
  for (int i = 0; i < str.size(); i++) {
    switch (str[i]) {
      case '!':
        broke[i % 4] += 1;
        break;
      default:
        color[i % 4] = str[i];
        break;
    }
  }
  int redBroke = 0, blueBroke = 0, yellowBroke = 0, greenBroke = 0;
  for (int i = 0; i < 4; i++) {
    switch (color[i]) {
      case 'R':
        redBroke = broke[i];
        break;
      case 'G':
        greenBroke = broke[i];
        break;
      case 'B':
        blueBroke = broke[i];
        break;
      case 'Y':
        yellowBroke = broke[i];
        break;
    }
  }
  cout << redBroke << " " << blueBroke << " " << yellowBroke << " "
       << greenBroke << endl;
}
