#include <bits/stdc++.h>
using namespace std;
char a[110];
const int maxn = 2e6 + 5;
int ansR, ansB, ansY, ansG;
int cnt1, cnt2, cnt3, cnt4;
int main() {
  cin >> a;
  int n = strlen(a);
  for (int i = 0; i < n; i++) {
    if (a[i] == 'R') ansR = i % 4;
    if (a[i] == 'B') ansB = i % 4;
    if (a[i] == 'Y') ansY = i % 4;
    if (a[i] == 'G') ansG = i % 4;
  }
  for (int i = 0; i < n; i++) {
    if (a[i] == '!') {
      if (i % 4 == ansR) cnt1++;
      if (i % 4 == ansB) cnt2++;
      if (i % 4 == ansY) cnt3++;
      if (i % 4 == ansG) cnt4++;
    }
  }
  cout << cnt1 << " " << cnt2 << " " << cnt3 << " " << cnt4 << endl;
  return 0;
}
