#include <bits/stdc++.h>
using namespace std;
char a[102];
int main() {
  string s;
  cin >> s;
  strcpy(a, s.c_str());
  int R = 0, B = 0, G = 0, Y = 0;
  int r = 0, b = 0, y = 0, g = 0;
  for (int i = 0; i < 102; i++) {
    if (a[i] == 'R') {
      R = i % 4;
    } else if (a[i] == 'G') {
      G = i % 4;
    } else if (a[i] == 'B') {
      B = i % 4;
    } else if (a[i] == 'Y') {
      Y = i % 4;
    }
  }
  for (int i = 0; i < 102; i++) {
    if (a[i] == '!' && i % 4 == R) {
      r++;
    } else if (a[i] == '!' && i % 4 == B) {
      b++;
    } else if (a[i] == '!' && i % 4 == Y) {
      y++;
    } else if (a[i] == '!' && i % 4 == G) {
      g++;
    }
  }
  cout << r << " " << b << " " << y << " " << g << endl;
  return 0;
}
