#include <bits/stdc++.h>
using namespace std;
const int pi = 3.14159265;
const int INF = 1 << 30;
const int maxn = 1e5;
string ss;
map<char, int> mp;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  char cc;
  int a = 0, b = 0;
  cin >> ss;
  for (int i = 0; i < ss.size(); i += 4) {
    if (ss[i] != '!') {
      cc = ss[i];
      b++;
    }
    ++a;
  }
  mp[cc] = a - b;
  a = b = 0;
  for (int i = 1; i < ss.size(); i += 4) {
    if (ss[i] != '!') {
      cc = ss[i];
      b++;
    }
    ++a;
  }
  mp[cc] = a - b;
  a = b = 0;
  for (int i = 2; i < ss.size(); i += 4) {
    if (ss[i] != '!') {
      cc = ss[i];
      b++;
    }
    ++a;
  }
  mp[cc] = a - b;
  a = b = 0;
  for (int i = 3; i < ss.size(); i += 4) {
    if (ss[i] != '!') {
      cc = ss[i];
      b++;
    }
    ++a;
  }
  mp[cc] = a - b;
  cout << mp['R'] << " " << mp['B'] << " " << mp['Y'] << " " << mp['G'] << endl;
}
