#include <bits/stdc++.h>
using namespace std;
long double pi = acos(-1.0);
long long int power(long long int x, long long int y) {
  long long int temp;
  if (y == 0) return 1;
  temp = power(x, y / 2);
  if (y % 2 == 0)
    return (temp * temp);
  else {
    if (y > 0)
      return (((x * temp)) * temp);
    else
      return (temp * temp) / x;
  }
}
long long int mul_inv(long long int n, long long int p, long long int m) {
  if (p == 1) {
    return n % m;
  } else if (p % 2 == 0) {
    long long int t = mul_inv(n, p / 2, m);
    return ((t) * (t)) % m;
  } else {
    long long int t = mul_inv(n, p / 2, m);
    return ((((n % m) * t) % m) * t) % m;
  }
}
bool isprime(long long int n) {
  if (n == 2) {
    return true;
  }
  if (n % 2 == 0) {
    return false;
  }
  for (long long int i = 3; i <= sqrt(n); i += 2) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      if (j == i) {
        continue;
      }
      for (int k = 0; k < 4; k++) {
        if (k == i || k == j) {
          continue;
        }
        for (int w = 0; w < 4; w++) {
          if (w == i || w == j || w == k) {
            continue;
          }
          string s1 = "";
          for (int u = 0; u < s.length(); u++) {
            s1 += "!";
          }
          for (int u = i; u < s.length(); u += 4) {
            s1[u] = 'R';
          }
          for (int u = j; u < s.length(); u += 4) {
            s1[u] = 'B';
          }
          for (int u = k; u < s.length(); u += 4) {
            s1[u] = 'Y';
          }
          for (int u = w; u < s.length(); u += 4) {
            s1[u] = 'G';
          }
          int f = 1;
          for (int u = 0; u < s.length(); u++) {
            if (s[u] == '!') {
              continue;
            } else if (s[u] != s1[u]) {
              f = 0;
              break;
            }
          }
          if (f) {
            int a1 = 0, a2 = 0, a3 = 0, a4 = 0;
            for (int u = 0; u < s.length(); u++) {
              if (s[u] == '!') {
                if (s1[u] == 'R') {
                  a1++;
                } else if (s1[u] == 'B') {
                  a2++;
                } else if (s1[u] == 'Y') {
                  a3++;
                } else {
                  a4++;
                }
              }
            }
            cout << a1 << " " << a2 << " " << a3 << " " << a4;
            return 0;
          }
        }
      }
    }
  }
  return 0;
}
