#include <bits/stdc++.h>
using namespace std;
const long long int mx = INT_MAX;
const long long int mn = INT_MIN;
const long long int mv = 1000005;
const double pi = 3.141592653589793238462643;
long long int n, a[4], b[4], c;
string s;
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cin >> s;
  for (int i = 0; i < (int)(s.size()); i++) {
    if (s[i] == 'R') {
      a[0] = (i + 1) % 4;
    }
    if (s[i] == 'B') {
      a[1] = (i + 1) % 4;
    }
    if (s[i] == 'Y') {
      a[2] = (i + 1) % 4;
    }
    if (s[i] == 'G') {
      a[3] = (i + 1) % 4;
    }
  }
  for (int i = 0; i < (int)(s.size()); i++) {
    if (s[i] == '!') {
      for (int j = 0; j < 4; j++) {
        if ((i + 1) % 4 == a[j]) {
          b[j]++;
        }
      }
    }
  }
  for (int i = 0; i < 4; i++) {
    cout << b[i] << " ";
  }
}
