#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  long long int i, c = 0;
  cin >> str;
  char arr[4] = {'0', '0', '0', '0'};
  string::iterator it;
  long long int le = str.length();
  for (i = 0; i < le && c < 4; ++i) {
    if (str[i] != '!' && arr[i % 4] == '0') {
      arr[i % 4] = str[i];
      ++c;
    }
  }
  long long int r = 0, b = 0, y = 0, g = 0;
  for (i = 0; i < le; ++i) {
    if (str[i] == '!') {
      if (arr[i % 4] == 'R')
        ++r;
      else if (arr[i % 4] == 'B')
        ++b;
      else if (arr[i % 4] == 'Y')
        ++y;
      else if (arr[i % 4] == 'G')
        ++g;
    }
  }
  cout << r << " " << b << " " << y << " " << g << endl;
}
