#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[105];
  cin >> a;
  int r = 0, b = 0, y = 0, g = 0;
  int n = strlen(a);
  vector<char> v(4, '!');
  for (int i = 0; i < n; i += 4) {
    int z = i;
    for (int j = 0; j < n && j < 4; j++) {
      if (v[j] == '!') v[j] = a[z + j];
    }
  }
  for (int i = 0; i < n; i += 4) {
    int z = i;
    for (int j = 0; j < n && j < 4; j++) {
      if (a[z + j] == '!') {
        if (v[j] == 'R')
          r++;
        else if (v[j] == 'B')
          b++;
        else if (v[j] == 'Y')
          y++;
        else if (v[j] == 'G')
          g++;
      }
    }
  }
  cout << r << " " << b << " " << y << " " << g << endl;
  return 0;
}
