#include <bits/stdc++.h>
using namespace std;
const string P[4] = {"Gryffindor", "Hufflepuff", "Ravenclaw", "Slytherin"};
int i, j, k, n, m;
int ma[10010][4], h[200], f[10010][1 << 8], a[4], F[4], s[10010][4];
char p[10010];
inline void get() {
  int j, k = 0;
  for (j = 0; j <= 3; j++) {
    int A = a[j] - ma[i + 1][j], B;
    if (abs(A) > 2) printf("%d %d %d\n", i + 1, j, A);
    if (abs(A) == 2)
      s[i + 1][j] = A, B = 3;
    else
      B = A + 1;
    k |= B << (j * 2);
  }
  f[i + 1][k] = 1;
}
int main() {
  scanf("%d%s", &n, p + 1);
  h['G'] = 0, h['H'] = 1, h['R'] = 2, h['S'] = 3, h['?'] = 4;
  for (i = 1; i <= n; i++) {
    int A = h[p[i]];
    for (j = 0; j <= 3; j++) ma[i][j] = ma[i - 1][j];
    if (A < 4)
      ma[i][A]++;
    else {
      int mi = 10010;
      for (j = 0; j <= 3; j++) mi = min(mi, ma[i][j]);
      for (j = 0; j <= 3; j++)
        if (mi == ma[i][j]) break;
      ma[i][j]++;
    }
  }
  k = 0;
  for (i = 0; i <= 3; i++) k |= 1 << (i * 2);
  f[0][k] = 1;
  for (i = 0; i <= n - 1; i++) {
    int A = h[p[i + 1]];
    for (j = 0; j <= 255; j++)
      if (f[i][j]) {
        for (k = 0; k <= 3; k++) {
          int B = j >> (k * 2) & 3;
          if (B == 3)
            B = s[i][k];
          else
            B--;
          a[k] = ma[i][k] + B;
        }
        if (A < 4)
          a[A]++, get();
        else {
          int mi = 10010;
          for (k = 0; k <= 3; k++) mi = min(mi, a[k]);
          for (k = 0; k <= 3; k++)
            if (mi == a[k]) {
              a[k]++;
              get();
              a[k]--;
            }
        }
      }
  }
  for (j = 0; j <= 255; j++)
    if (f[n][j]) {
      for (k = 0; k <= 3; k++) {
        int B = j >> (k * 2) & 3;
        if (B == 3)
          B = s[i][k];
        else
          B--;
        a[k] = ma[i][k] + B;
      }
      int mi = 10010;
      for (k = 0; k <= 3; k++) mi = min(mi, a[k]);
      for (k = 0; k <= 3; k++)
        if (mi == a[k]) F[k] = 1;
    }
  for (k = 0; k <= 3; k++)
    if (F[k]) cout << P[k] << endl;
  return 0;
}
