#include <bits/stdc++.h>
using namespace std;
template <class T>
void chmin(T& a, const T& b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T& a, const T& b) {
  if (a < b) a = b;
}
const long long INF = 1e18;
const int MOD = 3;
const int N = 1e6;
bool prime[N];
void sieve(int n) {
  memset(prime, true, sizeof(prime));
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * 2; i <= n; i += p) prime[i] = false;
    }
  }
}
int c;
int dis(int x, int y) { return min(abs(x - y), c - abs(x - y)); }
int main() {
  string s;
  cin >> s;
  long long n = s.size(), i, r = 0, b = 0, y = 0, g = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'R') {
      int j = i;
      while (j - 4 >= 0) {
        j -= 4;
        if (s[j] == '!') {
          s[j] = 'R';
          r++;
        }
      }
      j = i;
      while (j + 4 < n) {
        j += 4;
        if (s[j] == '!') {
          s[j] = 'R';
          r++;
        }
      }
    } else if (s[i] == 'G') {
      int j = i;
      while (j - 4 >= 0) {
        j -= 4;
        if (s[j] == '!') {
          s[j] = 'G';
          g++;
        }
      }
      j = i;
      while (j + 4 < n) {
        j += 4;
        if (s[j] == '!') {
          s[j] = 'G';
          g++;
        }
      }
    } else if (s[i] == 'B') {
      int j = i;
      while (j - 4 >= 0) {
        j -= 4;
        if (s[j] == '!') {
          s[j] = 'B';
          b++;
        }
      }
      j = i;
      while (j + 4 < n) {
        j += 4;
        if (s[j] == '!') {
          s[j] = 'B';
          b++;
        }
      }
    } else if (s[i] == 'Y') {
      int j = i;
      while (j - 4 >= 0) {
        j -= 4;
        if (s[j] == '!') {
          s[j] = 'Y';
          y++;
        }
      }
      j = i;
      while (j + 4 < n) {
        j += 4;
        if (s[j] == '!') {
          s[j] = 'Y';
          y++;
        }
      }
    }
  }
  cout << r << " " << b << " " << y << " " << g;
}
