#include <bits/stdc++.h>
using namespace std;
void finddead(char strin[], int n) {
  int i;
  char light[7];
  int need[7];
  int have[7];
  light[0] = 'x';
  need[0] = 0;
  have[0] = 0;
  for (i = 0; i < n; i = i + 4) {
    if (strin[i] != '!') {
      if (light[0] == 'x') {
        light[0] = strin[i];
      }
      have[0] = have[0] + 1;
    }
    need[0] = need[0] + 1;
  }
  light[1] = 'x';
  need[1] = 0;
  have[1] = 0;
  for (i = 1; i < n; i = i + 4) {
    if (strin[i] != '!') {
      if (light[1] == 'x') {
        light[1] = strin[i];
      }
      have[1] = have[1] + 1;
    }
    need[1] = need[1] + 1;
  }
  light[2] = 'x';
  need[2] = 0;
  have[2] = 0;
  for (i = 2; i < n; i = i + 4) {
    if (strin[i] != '!') {
      if (light[2] == 'x') {
        light[2] = strin[i];
      }
      have[2] = have[2] + 1;
    }
    need[2] = need[2] + 1;
  }
  light[3] = 'x';
  need[3] = 0;
  have[3] = 0;
  for (i = 3; i < n; i = i + 4) {
    if (strin[i] != '!') {
      if (light[3] == 'x') {
        light[3] = strin[i];
      }
      have[3] = have[3] + 1;
    }
    need[3] = need[3] + 1;
  }
  int Rdeed;
  int Bdeed;
  int Ydeed;
  int Gdeed;
  for (i = 0; i < 4; i++) {
    if (light[i] == 'R') {
      Rdeed = need[i] - have[i];
    } else if (light[i] == 'B') {
      Bdeed = need[i] - have[i];
    } else if (light[i] == 'Y') {
      Ydeed = need[i] - have[i];
    } else {
      Gdeed = need[i] - have[i];
    }
  }
  printf("%d %d %d %d\n", Rdeed, Bdeed, Ydeed, Gdeed);
}
int main() {
  char s[100];
  int i;
  for (i = 0; i < 100; i++) {
    char charect;
    scanf("%c", &charect);
    if (charect == '\n') break;
    s[i] = charect;
  }
  int length = i;
  finddead(s, length);
  return 0;
}
