#include <bits/stdc++.h>
const bool TEST = 0;
const int inf = 0x7fffffff;
using namespace std;
template <typename T>
void pA(T *begin, int n) {
  for (int i = 0; i < n; i++) {
    cout << *(begin++);
  }
  printf("\n");
}
const char cho[4] = {'R', 'B', 'Y', 'G'};
vector<unsigned int> fAns;
bool flag = 0;
bool check(string s, vector<unsigned int> ans) {
  if (flag) return 0;
  if (TEST) cout << s << endl;
  ;
  for (int c = 0; c < 4; c++) {
    int pre = -4;
    for (unsigned int i = 0; i < s.size(); i++) {
      if (s[i] == '!') {
        if (c == 3)
          return 1;
        else
          continue;
      }
      if (s[i] == cho[c]) {
        if (i - pre >= 4) {
          pre = i;
        } else
          return false;
      }
    }
  }
  fAns = ans;
  flag = 1;
  return 0;
}
int cor(char x) {
  switch (x) {
    case 'R':
      return 0;
    case 'B':
      return 1;
    case 'Y':
      return 2;
    case 'G':
      return 3;
  }
  return 30;
}
void count(string s, vector<unsigned int> ans) {
  if (TEST) cout << "int count" << s << endl;
  int sum = 0;
  for (unsigned int i = 0; i < 4; i++) {
    sum += cor(s[i]);
  }
  if (sum != 6) return;
  for (unsigned int i = 4; i < s.size(); i++) {
    if (s[i] == '!') {
      ans[cor(s[i - 4])]++;
    }
  }
  fAns = ans;
}
void dfs(unsigned int st, unsigned int curTol, const string s,
         vector<unsigned int> ans) {
  bool val = 0;
  val = check(s, ans);
  if (!val) return;
  if (st == 4) {
    count(s, ans);
  }
  if (TEST) cout << val << endl;
  for (unsigned int i = st; i < 4; i++) {
    if (s[i] == '!') {
      for (int c = 0; c < 4; c++) {
        string s2 = s;
        s2[i] = cho[c];
        ans[c]++;
        dfs(i + 1, curTol + 1, s2, ans);
        ans[c]--;
      }
      return;
    }
  }
  count(s, ans);
}
void sol() {
  string s;
  cin >> s;
  for (int i = 0; i < 4; i++) {
    fAns.push_back(0);
  }
  dfs(0, 0, s, fAns);
  for (int i = 0; i < 4; i++) {
    if (0 != i) cout << ' ';
    cout << fAns[i];
  }
  cout << endl;
}
void sol2() {
  string s;
  cin >> s;
  for (int i = 0; i < 4; i++) {
    fAns.push_back(0);
  }
  for (int c = 0; c < 4; c++) {
    char x = cho[c];
    unsigned int pos = s.find_first_of(x);
    pos %= 4;
    for (unsigned int i = pos; i < s.size(); i += 4) {
      if ('!' == s[i]) fAns[cor(x)]++;
    }
  }
  for (int i = 0; i < 4; i++) {
    if (0 != i) cout << ' ';
    cout << fAns[i];
  }
  cout << endl;
}
int main() {
  sol2();
  return 0;
}
