#include <bits/stdc++.h>
using namespace std;
string str;
bool valid() {
  for (int i = 0; i < (int)str.size(); i++)
    if (str[i] == '!') return false;
  return true;
}
int main() {
  cin >> str;
  int n = (int)str.size();
  int R = 0, B = 0, G = 0, Y = 0;
  int i = 0;
  while (true) {
    if (valid()) break;
    if (str[i] == '!') {
      if ((i + 4) < n && (str[i + 4] != '!')) {
        str[i] = str[i + 4];
        if (str[i + 4] == 'R')
          R++;
        else if (str[i + 4] == 'B')
          B++;
        else if (str[i + 4] == 'Y')
          Y++;
        else
          G++;
      } else if ((i - 4) >= 0 && (str[i - 4] != '!')) {
        str[i] = str[i - 4];
        if (str[i - 4] == 'R')
          R++;
        else if (str[i - 4] == 'B')
          B++;
        else if (str[i - 4] == 'Y')
          Y++;
        else
          G++;
      }
    }
    i++;
    if (i == n) i = 0;
  }
  cout << R << " " << B << " " << Y << " " << G << endl;
  return 0;
}
