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