#include <bits/stdc++.h>
using namespace std;
int pool[200];
int color[5];
int row[5], mark[5];
bool mk[5];
int main() {
  string rbyg;
  cin >> rbyg;
  int max = rbyg.length() / 4;
  for (int i = 0; i < max * 4; i++) {
    if (rbyg[i] == 'R') {
      pool[i] = 1;
      mark[1]++;
    }
    if (rbyg[i] == 'B') {
      pool[i] = 2;
      mark[2]++;
    }
    if (rbyg[i] == 'Y') {
      pool[i] = 3;
      mark[3]++;
    }
    if (rbyg[i] == 'G') {
      pool[i] = 4;
      mark[4]++;
    }
    if (rbyg[i] == '!') {
      pool[i] = 0;
    }
  }
  for (int i = max * 4; i < rbyg.length(); i++) {
    if (rbyg[i] == 'R') {
      pool[i] = 1;
    }
    if (rbyg[i] == 'B') {
      pool[i] = 2;
    }
    if (rbyg[i] == 'Y') {
      pool[i] = 3;
    }
    if (rbyg[i] == 'G') {
      pool[i] = 4;
    }
    if (rbyg[i] == '!') {
      pool[i] = 0;
    }
  }
  if (rbyg.length() % 4) {
    memset(row, 0, sizeof(row));
    for (int k = 0; k < 4; k++) {
      for (int i = 0; i < rbyg.length(); i = i + 4) {
        if (pool[i + k]) {
          row[k] = pool[i + k];
          break;
        }
      }
    }
    for (int i = 0; i < 4; i++) {
      if (row[i]) {
        mk[row[i]] = true;
      }
    }
    for (int i = 0; i < 4; i++) {
      if (!row[i]) {
        for (int j = 1; j <= 4; j++) {
          if (!mk[j]) {
            row[i] = j;
            mk[j] = true;
            break;
          }
        }
      }
    }
    int cc = rbyg.length() / 4;
    int z = rbyg.length() % 4;
    int start = cc * 4;
    for (int i = 0; i < z; i++) {
      if (pool[i + start] == 0) {
        mark[row[i]]--;
      }
    }
    cout << max - mark[1] << " ";
    cout << max - mark[2] << " ";
    cout << max - mark[3] << " ";
    cout << max - mark[4];
  } else {
    cout << max - mark[1] << " ";
    cout << max - mark[2] << " ";
    cout << max - mark[3] << " ";
    cout << max - mark[4];
  }
  return 0;
}
