#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int l = s.size();
  pair<int, char> ar[4];
  for (int i = 0; i < l; i += 4) {
    if (s[i] == 'R') {
      ar[0].second = 'R';
    } else if (s[i] == 'B') {
      ar[0].second = 'B';
    } else if (s[i] == 'Y') {
      ar[0].second = 'Y';
    } else if (s[i] == 'G') {
      ar[0].second = 'G';
    } else {
      ar[0].first++;
    }
  }
  for (int i = 1; i < l; i += 4) {
    if (s[i] == 'R') {
      ar[1].second = 'R';
    } else if (s[i] == 'B') {
      ar[1].second = 'B';
    } else if (s[i] == 'Y') {
      ar[1].second = 'Y';
    } else if (s[i] == 'G') {
      ar[1].second = 'G';
    } else {
      ar[1].first++;
    }
  }
  for (int i = 2; i < l; i += 4) {
    if (s[i] == 'R') {
      ar[2].second = 'R';
    } else if (s[i] == 'B') {
      ar[2].second = 'B';
    } else if (s[i] == 'Y') {
      ar[2].second = 'Y';
    } else if (s[i] == 'G') {
      ar[2].second = 'G';
    } else {
      ar[2].first++;
    }
  }
  for (int i = 3; i < l; i += 4) {
    if (s[i] == 'R') {
      ar[3].second = 'R';
    } else if (s[i] == 'B') {
      ar[3].second = 'B';
    } else if (s[i] == 'Y') {
      ar[3].second = 'Y';
    } else if (s[i] == 'G') {
      ar[3].second = 'G';
    } else {
      ar[3].first++;
    }
  }
  for (int i = 0; i < 4; i++) {
    if (ar[i].second == 'R') {
      printf("%d ", ar[i].first);
      break;
    }
  }
  for (int i = 0; i < 4; i++) {
    if (ar[i].second == 'B') {
      printf("%d ", ar[i].first);
      break;
    }
  }
  for (int i = 0; i < 4; i++) {
    if (ar[i].second == 'Y') {
      printf("%d ", ar[i].first);
      break;
    }
  }
  for (int i = 0; i < 4; i++) {
    if (ar[i].second == 'G') {
      printf("%d ", ar[i].first);
      break;
    }
  }
}
