#include <bits/stdc++.h>
using namespace std;
string arr;
int Sol(char c) {
  int ind = 0;
  for (int i = 0; i < arr.size(); ++i) {
    if (arr[i] == c) {
      ind = i % 4;
      break;
    }
  }
  int count = 0;
  for (int i = ind; i < arr.size(); i += 4) {
    if (arr[i] == '!') count++;
  }
  return count;
}
int main() {
  cin >> arr;
  cout << Sol('R') << " " << Sol('B') << " " << Sol('Y') << " " << Sol('G');
}
