#include <bits/stdc++.h>
using namespace std;
template <typename T>
T power(T a, T b, T m) {
  T x = 1, y = a;
  while (b > 0) {
    if (b & 1) {
      x = (x * y) % m;
    }
    y = (y * y) % m;
    b /= 2;
  }
  return x % m;
}
int main() {
  string s;
  cin >> s;
  int r, b, y, g;
  r = b = y = g = 0;
  int l = s.length();
  for (int i = 0; i < l; i++) {
    if (s[i] == 'R') {
      for (int j = i % 4; j < l; j += 4) {
        if (s[j] == '!') {
          r++;
        }
      }
      cout << r << " ";
      break;
    }
  }
  for (int i = 0; i < l; i++) {
    if (s[i] == 'B') {
      for (int j = i % 4; j < l; j += 4) {
        if (s[j] == '!') {
          b++;
        }
      }
      cout << b << " ";
      break;
    }
  }
  for (int i = 0; i < l; i++) {
    if (s[i] == 'Y') {
      for (int j = i % 4; j < l; j += 4) {
        if (s[j] == '!') {
          y++;
        }
      }
      cout << y << " ";
      break;
    }
  }
  for (int i = 0; i < l; i++) {
    if (s[i] == 'G') {
      for (int j = i % 4; j < l; j += 4) {
        if (s[j] == '!') {
          g++;
        }
      }
      cout << g << endl;
      break;
    }
  }
  return 0;
}
