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